Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/nickserv/rsc-testing
- Owner: nickserv
- Created: 2023-05-15T21:52:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-12T19:33:19.000Z (3 months ago)
- Last Synced: 2024-10-13T14:42:08.711Z (23 days ago)
- Topics: nextjs, react, react-server-components, rsc, server-rendering, testing
- Language: TypeScript
- Homepage: https://github.com/testing-library/react-testing-library/issues/1209#issuecomment-1569813305
- Size: 892 KB
- Stars: 8
- Watchers: 5
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
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.