This is an example Next.js project testing React Server Components with React Testing Library in Vitest.
It follows my workarounds for React Server Components .
Using Jest? See the Jest branch.
Install dependencies and run tests:
pnpm install-test
You can also run the Next.js server:
pnpm dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.