-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjest.config.js
38 lines (36 loc) · 1.03 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
const { pathsToModuleNameMapper } = require("ts-jest/utils");
const globalConstants = require("./webpack/globalConstants");
const { compilerOptions } = require("./tsconfig");
module.exports = {
globals: {
...Object.keys(globalConstants).reduce((acc, key) => {
acc[key] = globalConstants[key];
return acc;
}, {}),
},
setupFiles: ["<rootDir>/jest/setupFile.js"],
setupFilesAfterEnv: ["<rootDir>/jest/setupFileAfterEnv.js"],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: "<rootDir>/",
}),
testPathIgnorePatterns: [
"<rootDir>[/\\\\](artifacts|node_modules|scripts)[/\\\\]",
"<rootDir>/artifacts/webpack/package.json",
],
collectCoverageFrom: [
"src/**/*.{ts,tsx}",
"!**/node_modules/**",
"!src/typings/**/*",
"!**/*.testUtils.{ts,tsx}",
"!**/testUtils/**",
],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
},
},
testRegex: "((\\.|/)(test|spec))\\.[jt]sx?$",
modulePaths: ["<rootDir>/src"],
};