57dcc9d329
This command changed in pnpm [6.32.13](https://github.com/pnpm/pnpm/releases/tag/v6.32.13) and [7.1.1](https://github.com/pnpm/pnpm/releases/tag/v7.1.1) so lets update it since its been a few weeks and we can expect pnpm users to update more regularly than npm users. - Fixes https://github.com/vercel/next.js/pull/37240 - Fixes https://github.com/vercel/next.js/pull/37045 - Fixes https://github.com/vercel/next.js/pull/37032 - Fixes https://github.com/vercel/next.js/pull/36602 - Fixes https://github.com/vercel/next.js/pull/36496 |
||
---|---|---|
.. | ||
__mocks__ | ||
__tests__ | ||
pages | ||
public | ||
styles | ||
.eslintrc.json | ||
.gitignore | ||
jest.config.js | ||
jest.setup.js | ||
next-env.d.ts | ||
package.json | ||
README.md | ||
tsconfig.json | ||
types.d.ts |
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
Quickly get started using Create Next App!
In your terminal, run the following command:
npx create-next-app --example with-jest-babel with-jest-babel-app
# or
yarn create next-app --example with-jest-babel with-jest-babel-app
# or
pnpm create next-app --example with-jest-babel with-jest-babel-app
Run Jest Tests
npm test