Search across all documentation pages
16 pages in this section.
Set up Vitest with Next.js 15 and React 19 - config, jsdom environment, Testing Library, path aliases, and CSS handling for unit tests.
Configure Jest with Next.js using the official next/jest preset for zero-config TypeScript and path alias support.
Test your components the way users interact with them -- by querying accessible elements, not implementation details.
Test React components for rendering with props, user interactions, conditional UI, and dynamic content using testing-library and user-event.
Test custom hooks in isolation using renderHook -- verify state changes, async behavior, and context dependencies.
Mocking in React tests - vi.mock, module factories, partial mocks, fetch and MSW, timers, modules with side effects, and reset patterns.
Test React forms with Vitest and Testing Library - controlled inputs, validation messages, submission flows, and React Hook Form patterns.
Test async React behavior with Vitest and Testing Library - waitFor, findBy queries, fake timers, and patterns for promises and effects.
Learn to test components relying on React Context, Zustand, or other global state providers. Control provided values and reset stores between tests.
Test Next.js App Router Server Components, Server Actions, and Route Handlers in isolation by treating them as plain async functions.
Install and configure Playwright for end-to-end testing your Next.js application. Learn to set up CI, run tests, and debug.
Learn Playwright E2E testing patterns including Page Object Model, robust locators, assertions, and visual regression for maintainable tests.
Advanced Playwright patterns for Next.js - auth state reuse, network mocking, visual diffs, parallelism, and CI-friendly debugging tactics.
React testing strategy and best practices - unit, integration, end-to-end split, behavior over implementation, and what to test in Next.js apps.
Learn 25 essential testing best practices, including preferring getByRole over Test IDs, using queryBy for absence, and awaiting every userEvent call.
A single-page roundup of every highlight bullet from the 15 pages in the Testing section, grouped by source page so you can scan all 90 takeaways without opening each article individually.