generated from andreidmt/tpl-lib-react-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
40 lines (37 loc) · 1009 Bytes
/
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
/* eslint-env node */
/** @type {import('@jest/types').Config.InitialOptions} */
export default {
testEnvironment: "jsdom",
testMatch: ["**/tests/*.ts(x)?", "**/*.test.ts(x)?"],
testPathIgnorePatterns: ["/node_modules/", "/dist/"],
setupFilesAfterEnv: ["./jest.setup.js"],
moduleDirectories: ["node_modules", "src"],
transform: {
"^.+\\.(t|j)sx?$": ["@swc/jest", {}],
},
collectCoverageFrom: ["./src/**/*.{ts,tsx}"],
coveragePathIgnorePatterns: ["/node_modules/"],
coverageDirectory: "coverage",
coverageThreshold: {
global: {
branches: 90,
functions: 90,
lines: 90,
},
},
coverageReporters: ["lcov", "text"],
reporters:
process.env.CI === "true"
? [
"default",
[
"jest-junit",
{
suiteName: "Unit tests - useCrudState",
outputDirectory: "./test_reports/unit_tests",
outputName: "junit.xml",
},
],
]
: ["default"],
}