Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nickserv/rsc-testing

Example Next.js project testing React Server Components with React Testing Library in Vitest
https://github.com/nickserv/rsc-testing

nextjs react react-server-components rsc server-rendering testing

Last synced: 9 days ago
JSON representation

Example Next.js project testing React Server Components with React Testing Library in Vitest

Awesome Lists containing this project

README

        

This is an example [Next.js](https://nextjs.org/) project testing
[React Server Components](https://react.dev/blog/2020/12/21/data-fetching-with-react-server-components)
with [React Testing Library](https://testing-library.com/react) in [Vitest](https://vitest.dev/).

It follows my [workarounds for React Server Components
](https://github.com/testing-library/react-testing-library/issues/1209#issuecomment-1569813305).

Using Jest? See the [Jest branch](https://github.com/nickmccurdy/rsc-testing/tree/jest).

## Getting Started

Install dependencies and run tests:

```bash
npm install-test
```

You can also run the Next.js server:

```bash
npm run dev
```

Open [http://localhost:3000](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.