mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
## Description I have corrected some mistakes according to the [contribution guide](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md). 1. Update `create-next-app` script 2. Remove redundant new line, space and double colon 3. `readme.md` → `README.md` ### Adding or Updating Examples - [x] The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - [x] Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md --------- Co-authored-by: Sam Ko <[email protected]>
1.7 KiB
1.7 KiB
Vitest
This example shows how to use Vitest with Next.js.
This includes Next.js' built-in support for Global CSS, CSS Modules and TypeScript. This example also shows how to use Vitest with the App Router and React Server Components.
Note: Since tests can be co-located alongside other files inside the App Router, we have placed those tests in
app/to demonstrate this behavior (which is different thanpages/). You can still place all tests in__tests__if you prefer.
Deploy your own
How to use
Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example with-vitest with-vitest-app
yarn create next-app --example with-vitest with-vitest-app
pnpm create next-app --example with-vitest with-vitest-app
Deploy it to the cloud with Vercel (Documentation).
Running Tests
npm test
yarn test
pnpm test
Deploy it to the cloud with Vercel (Documentation).