@checkdigit/jest-config v6.0.2
jest-config
Copyright (c) 2023–2024 Check Digit, LLC
Check Digit Jest presets and configuration.
Install
$ npm i @checkdigit/jest-config --save-dev
Note that @checkdigit/jest-config
automatically brings in the correct versions of
jest
, ts-jest
and @jest/globals
via peerDependencies
. Do not install these packages separately.
ESM
@checkdigit/jest-config
is now ESM only.
It only supports testing with ESM modules,
i.e., you must have "type": "module"
in your package.json
file.
Note that the Node --experimental-vm-modules
flag is required for ESM modules. See the
Jest docs for more information.
.env
The project .env
file is automatically loaded via process.loadEnvFile()
(available in Node.js 20.12 or later).
Example
ESM package.json
Note: this requires Node.js v20.11 or later.
{
// ...
"type": "module",
"scripts": {
"test": "NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=false"
"test:coverage": "NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=true"
}
// ...
"jest": {
"preset": "@checkdigit/jest-config"
}
}
License
MIT
8 hours ago
7 hours ago
9 days ago
9 days ago
9 days ago
9 days ago
9 days ago
3 months ago
3 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
9 months ago
9 months ago
6 months ago
8 months ago
8 months ago
10 months ago
10 months ago
10 months ago
10 months ago
8 months ago
8 months ago
9 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago