First-class Vite integration for Jest.
Still work-in-progress, here are some working examples:
type: "module"
in package.json
type: "commonjs"
or no type
field in package.json
.mjs
extension in this case.type: "module"
in package.json
fastRefresh
option of @vitejs/plugin-react
must be turned off when process.env.NODE_ENV === 'test'
Usage:
preset: 'vite-jest'
to your Jest config.jest
CLI with vite-jest
.See ./packages/vite-jest/README.md for more detailed guidelines and implementation notes.