onweer / with-jest-and-esm

Example of configuration for running tests while using Next.js, Next/Jest, Yarn PnP and ESM library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example of configuration for running tests while using the following combination:

  • Next.js
  • Next/Jest
  • Yarn PnP
  • ESM library

Forked from https://github.com/vercel/next.js/tree/canary/examples/with-jest


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.

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
# or
yarn create next-app --example with-jest with-jest-app
# or
pnpm create next-app --example with-jest with-jest-app

Run Jest Tests

npm test

About

Example of configuration for running tests while using Next.js, Next/Jest, Yarn PnP and ESM library


Languages

Language:JavaScript 48.9%Language:TypeScript 40.2%Language:CSS 10.9%