-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
48 lines (48 loc) · 1.25 KB
/
jest.config.js
File metadata and controls
48 lines (48 loc) · 1.25 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/** @type {import('jest').Config} */
export default {
preset: "ts-jest",
testEnvironment: "jsdom",
roots: ["<rootDir>/tests", "<rootDir>/src"],
testMatch: ["**/__tests__/**/*.ts", "**/?(*.)+(spec|test).ts"],
transform: {
"^.+\\.ts$": [
"ts-jest",
{
useESM: true,
tsconfig: {
module: "ESNext",
target: "ES2020",
esModuleInterop: true,
moduleResolution: "node",
},
},
],
},
extensionsToTreatAsEsm: [".ts"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
"^i45-jslogger$": "<rootDir>/tests/__mocks__/i45-jslogger.ts",
"^i45-sample-data$": "<rootDir>/tests/__mocks__/i45-sample-data.ts",
},
transformIgnorePatterns: ["node_modules/(?!(i45-sample-data|i45-jslogger)/)"],
collectCoverageFrom: [
"src/**/*.ts",
"!src/**/*.d.ts",
"!src/index.ts",
"!src/@types/**",
"!src/services/cookieService.ts", // Not yet integrated
],
coverageDirectory: "coverage",
coverageReporters: ["text", "lcov", "html", "json-summary"],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
setupFilesAfterEnv: ["<rootDir>/tests/setup.ts"],
verbose: true,
testTimeout: 10000,
};