rsnext/examples/with-jest
2023-12-13 07:02:53 -08:00
..
__tests__ Update Jest and Vitest example for App Router. (#54989) 2023-09-05 13:31:47 +00:00
app Docs: Add App Router Testing Guides and update /examples (#59268) 2023-12-12 22:30:23 -06:00
pages Docs: Add App Router Testing Guides and update /examples (#59268) 2023-12-12 22:30:23 -06:00
public Update Jest examples and docs (#31633) 2021-11-30 15:10:40 -06:00
styles New Jest Example (#10396) 2020-02-03 20:36:55 +01:00
.gitignore Add .yarn/install-state.gz to .gitignore (#56637) 2023-10-18 16:34:48 +00:00
jest.config.js Docs: Add App Router Testing Guides and update /examples (#59268) 2023-12-12 22:30:23 -06:00
jest.setup.js Update Jest and Vitest example for App Router. (#54989) 2023-09-05 13:31:47 +00:00
next-env.d.ts Remove incorrect entries for pnpm debug log (#47241) 2023-03-26 22:26:05 -07:00
package.json Docs: Fix formatting in testing docs and update examples dependencies (#59572) 2023-12-13 07:02:53 -08:00
README.md Update Jest and Vitest example for App Router. (#54989) 2023-09-05 13:31:47 +00:00
tsconfig.json Docs: Add App Router Testing Guides and update /examples (#59268) 2023-12-12 22:30:23 -06:00
types.d.ts chore: convert Jest examples to TypeScript (#32705) 2021-12-22 01:12:07 +01:00

Next.js + Jest

This example shows how to configure Jest to work with Next.js.

This includes Next.js' built-in support for Global CSS, CSS Modules and TypeScript. This example also shows how to use Jest 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 than pages/). You can still place all tests in __tests__ if you prefer.

Deploy your own

Deploy with Vercel

How to Use

Quickly get started using Create Next App!

In your terminal, run the following command:

npx create-next-app --example with-jest with-jest-app
yarn create next-app --example with-jest with-jest-app
pnpm create next-app --example with-jest with-jest-app

Running Tests

npm test