@vbetsch/config-jest
v1.0.3
Published
My Jest configuration files
Readme
@vbetsch/config-jest
A modular Jest configuration collection for TypeScript projects, optimized for speed and reliability using modern transformers like SWC.
🧩 Modules
This package provides several configuration modules that can be composed to fit your project's needs:
| Module | Description |
|----------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| base | Core Jest configuration for Node.js and TypeScript. |
| dom | Specialized configuration for browser-like environments (JSDOM). |
| strict | Opinionated high-performance setup using SWC and strict type checking. |
🏗️ Installation
We recommend using Node version lts/krypton -> v24.14.1.
Install the NPM package in your project:
npm install -D @vbetsch/config-jestYou have to install @types/jest if you want to write Jest tests in TypeScript.
Note: Depending on the modules you use (e.g., dom or strict), you must also install the corresponding peer dependencies like jest-environment-jsdom or @swc/jest.
- base:
- No more dependencies needed
- dom:
- jest-environment-jsdom
- strict:
- @swc/jest
🚀 Getting started
To use these configurations, import them into your flat jest.config.mjs file:
// NOTE: You can name imports like you want
import baseVbetsch from '@vbetsch/config-jest/base';
import strictVbetsch from '@vbetsch/config-jest/strict';
export default {
...baseVbetsch,
...strictVbetsch,
};Check out the vbetsch/lib-config-ts-test repository for a live integration example.
🤝 Contributing
Please refer to the Root README for contribution guidelines.
