RSC Test Helper

JSON →
library 0.1.4 ·javascript
verified May 27, 2026

rsc-test-helper is a utility designed to enable unit testing of React components that consume async/await React Server Components (RSCs) within client-side testing environments like `@testing-library/react` or `react-test-renderer`. As of version 0.1.4, this package provides a `patch` function that transforms an async React component tree into a synchronous one by awaiting promises, thus making them compatible with standard React test renderers which do not natively support async component types. This is particularly useful for projects utilizing Next.js App Directory beta features (introduced in Next.js 13 in October 2022 and stabilized in 13.4 in June 2023), where RSCs return promises, causing errors in testing setups. The package currently has an early-stage development status with an undefined release cadence, focusing on solving an immediate testing pain point before official React/Next.js testing support for RSCs. A key differentiator is its specific focus on resolving the "Objects are not valid as a React child (found: [object Promise])" error encountered when rendering async RSCs in tests, especially in environments like JSDOM.

total hits 17
actors 6 distinct systems
last hit 1d ago human
GPTBot
5
MetaBot
4
Script
1
ClaudeBot
1
Search engines
1
Humans
2

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇸🇬 Singapore · 🇩🇪 Germany