-
Notifications
You must be signed in to change notification settings - Fork 4
/
jest.config.js
96 lines (81 loc) · 2.3 KB
/
jest.config.js
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/** @type {import('jest').Config} */
const config = {
collectCoverage: true,
collectCoverageFrom: [
"src/**/*.ts",
"!src/cli.ts",
"!tests/**",
"!**/node_modules/**",
],
coverageDirectory: "coverage",
coverageProvider: "v8",
coverageReporters: [
"json",
"text",
"clover",
"html",
],
coverageThreshold: {
// Note: we have several deprecated functions that reduce coverage
global: {
statements: 89,
branches: 84,
functions: 82,
lines: 89,
},
},
moduleDirectories: ["node_modules"],
workerIdleMemoryLimit: "500MB",
moduleFileExtensions: [
"ts",
"js",
"mjs",
"cjs",
"json",
],
extensionsToTreatAsEsm: [".ts"],
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources
// with a single module
moduleNameMapper: {
"(.+)\\.js": "$1"
},
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module
// loader
// modulePathIgnorePatterns: [],
// Activates notifications for test results
// notify: false,
// An enum that specifies notification mode. Requires { notify: true }
// notifyMode: "failure-change",
// A preset that is used as a base for Jest's configuration
preset: "ts-jest/presets/js-with-ts-esm",
// The test environment that will be used for testing
testEnvironment: "node",
// Options that will be passed to the testEnvironment
testEnvironmentOptions: {},
// Adds a location field to test results
// testLocationInResults: false,
// The glob patterns Jest uses to detect test files
testMatch: [
"**/tests/**/*.test.ts",
],
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: [
],
// The regexp pattern or array of patterns that Jest uses to detect test files
// testRegex: [],
testTimeout: 30000,
// A map from regular expressions to paths to transformers
transform: {
},
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip
// transformation
transformIgnorePatterns: [
"node_modules/",
],
globals: {
"ts-jest": {
tsconfig: `tests/tsconfig.json`
}
}
};
module.exports = config