Testing · Senior · Question 35 of 75
How do you test async React Server Components?
- ✓Correct answer: Mainly with E2E tests: RTL/jsdom can't render async server components; extract logic into plain functions for unit tests
- 2With
render(await Page())in jsdom - it's fully supported - 3Server components can't be tested
Explanation
The Next.js docs recommend E2E testing for async Server Components, since unit tools don't support them yet.