-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
46 lines (43 loc) · 1.08 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
// https://dev.to/teyim/effortless-testing-setup-for-react-with-vite-typescript-jest-and-react-testing-library-1c48
export default {
testEnvironment: "jsdom",
transform: {
"^.+\\.tsx?$": "ts-jest",
},
moduleNameMapper: {
"\\.(css|less|sass|scss)$": "identity-obj-proxy",
"^.+\\.svg$": "jest-transformer-svg",
"^@/(.*)$": "<rootDir>/src/$1",
},
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
globals: {
"ts-jest": {
tsConfig: "tsconfig.app.json"
},
coverageThreshold: {
global: {
branches: 60,
functions: 80,
lines: 80,
statements: 80
}
},
collectCoverageFrom: [
'<rootDir>/src/**/*.{tsx}',
],
coveragePathIgnorePatterns: [
"node_modules",
"test-config",
"interfaces",
"jestGlobalMocks.ts",
".module.ts",
"<rootDir>/src/app/main.ts",
".mock.ts",
"<rootDir>/src/**/*(index|types).{ts}"
],
modulePathIgnorePatterns: [
"node_modules",
"<rootDir>/src/**/*(index|types).{ts}"
],
}
};