What to Test at Each Level

A request passes through five stages, and no single tool reaches all of them.

How far each kind of test reaches into a Next.js request
How far each kind of test reaches into a Next.js 10,514 request

The overlap is where the cost lives. A page module is a plain export, so its synchronous parts are cheap to test; its asynchronous parts drag in the request scope, and the further a unit test pushes toward the server, the more of Next.js you end up mocking.

Where each part of a Next.js application belongs in a test suite
Artifact Best tested by Why
Validators, formatters, data helpers Vitest 102,989 or Jest 62,362 , no DOM Ordinary modules
Client and synchronous Server Components Vitest or Jest + Testing Library 221,825 jsdom 21,691 is enough
Async Server Components Playwright 26,280 , or await the function No runner renders them as JSX
Server Action bodies Vitest or Jest, next/cache mocked Import and call directly
proxy.ts, caching, streaming Playwright Only the real server runs them

Two rules follow. Push behavior you want covered quickly into plain modules a route merely calls, and budget for a real end-to-end run: caching, prefetching, streaming and proxy.ts have no stand-in.