-
Notifications
You must be signed in to change notification settings - Fork 62
/
jest.config.ts
116 lines (90 loc) · 3.12 KB
/
jest.config.ts
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
* This file is released under the MIT license.
* Copyright (c) 2023 Mike Lischke
*
* See LICENSE file for more info.
*/
import type { Config } from "jest";
const config: Config = {
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// An array of glob patterns indicating a set of files for which coverage information should be collected
collectCoverageFrom: [
"src/**/*.ts",
"!tests/**",
"!**/node_modules/**",
],
// The directory where Jest should output its coverage files
coverageDirectory: "coverage",
// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",
// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: [
"json",
"text",
"clover",
"html",
],
// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
statements: 65,
branches: 70,
functions: 50,
lines: 65,
},
},
// An array of directory names to be searched recursively up from the requiring module's location
moduleDirectories: [
"node_modules"
],
workerIdleMemoryLimit: "500MB",
// An array of file extensions your modules use
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/**/*.spec.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/",
],
};
export default config;