Learn how to write tests in Next.js with React Testing Library, Jest, and TypeScript. This tutorial takes you through the setup for testing in Next.js 13 with App Router and TypeScript step-by-step. Write your first tests in Next.js!
(00:00) Intro
(00:11) Welcome
(00:35) Lesson Goals
(01:06) Create a Next.js Project
(02:50) Add dependencies
(04:11) Current issue with Next.js & Jest
(06:17) Add scripts
(06:49) Jest config
(10:04) Jest setup
(10:33) ESLint
(12:17) Writing Your First Component Test & AAA Pattern
(19:20) Multiple Tests for the Same Component
(23:49) For More Information
🔗 Source Code: https://github.com/gitdagray/next-testing-intro
📚 Tutorial References:
🔗 Next.js Official Site: https://nextjs.org/
🔗 React Testing Library: https://testing-library.com/docs/react-testing-library/intro
🔗 Jest: https://jestjs.io/
🔗 TypeScript: https://www.typescriptlang.org/
Was this tutorial about getting started with Jest, React Testing Library and TypeScript in Next.js helpful? If so, please share. Let me know your thoughts in the comments.
#nextjs #react #testing #typescript