mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
49cba424e8
## 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 <sam@vercel.com>
1.1 KiB
1.1 KiB
Next.js + Jest
This example shows how to configure Jest to work with Next.js and Babel. Since the release of Next.js 12, Next.js has in-built configuration for Jest with SWC. See the with-jest example for the latest implementation.
This includes Next.js' built-in support for Global CSS, CSS Modules and TypeScript.
How to Use
Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example with-jest-babel with-jest-babel-app
yarn create next-app --example with-jest-babel with-jest-babel-app
pnpm create next-app --example with-jest-babel with-jest-babel-app
Run Jest Tests
npm test
yarn test
pnpm test
Deploy it to the cloud with Vercel (Documentation).