Skip to content

nicnocquee/rsc-testing

Repository files navigation

About

This is a sample project that shows how to test async React Server Components in Next.js using

Hopefully there will be official support for this in the future.

The component

The component that is being tested is a Greeting component that displays "Good morning" if the current time is before 12pm, and "Good afternoon" if the current time is after 12pm.

Running the tests

The test file can be found in greeting.test.tsx.

npm run test

So far this hack still works with Next.js 15.4.1 and React 19.1.0.

Blog Post

Read the blog post here.

About

A sample project that shows how to test React server component

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published