-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathjest.config.js
More file actions
30 lines (30 loc) · 838 Bytes
/
jest.config.js
File metadata and controls
30 lines (30 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//module.exports = {
// preset: 'ts-jest',
// testEnvironment: 'node',
//};
//
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
// [...]
preset: "ts-jest/presets/default-esm", // or other ESM presets
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
"^src/(.*)$": "<rootDir>/src/$1",
},
testPathIgnorePatterns: ["/__tests__/mocks/"],
globals: {
"BUILD_TYPE": "production",
},
transform: {
".ts": [
"ts-jest",
{
// Note: We shouldn't need to include `isolatedModules` here because it's a deprecated config option in TS 5,
// but setting it to `true` fixes the `ESM syntax is not allowed in a CommonJS module when
// 'verbatimModuleSyntax' is enabled` error that we're seeing when running our Jest tests.
isolatedModules: true,
useESM: true,
},
],
},
};