Module 10 of 10

Testing, Deployment & Performance

Lessons

About This Module

Before you ship, you want confidence that the app works. Next.js supports unit and component tests with Jest and React Testing Library, and end-to-end tests with tools like Playwright that drive a real browser against your running app. This module shows how to set each of them up in a Next.js project.

Then you will put the app online. Deploying to Vercel, the company behind Next.js, covers connecting a Git repository, deploying from the CLI, environment variables, preview URLs for branches, and a custom domain. Performance work such as caching, image and font optimization is covered in earlier modules and applies directly to what you deploy here. The testing videos were recorded for older Next.js versions, so check the current testing docs for exact setup details.

Once you have finished the lessons, move on to the Projects section to build something with everything you have learned.

Lessons

4 videos
01

How to: Test Next.js with Jest & RTL

Sets up Jest in a Next.js app using the next/jest library, to enable test-driven development and confident refactoring.

02

Set Up Next JS With Jest, React Testing Library and Playwright

Configures a Next.js project with Jest and React Testing Library for unit tests and Playwright for end-to-end tests.

03

Deploy Next.js to Vercel

Two ways to deploy (CLI and GitHub integration), push-to-deploy with preview URLs, environment variables, a custom domain with HTTPS, and a production checklist.

04

Deploying Next.js to Vercel

A short walkthrough of deploying from a template, by pushing commits to a Git repository, and with the Vercel CLI.