-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
51 lines (49 loc) · 1.44 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
import type { Config } from "jest";
import { pathsToModuleNameMapper } from "ts-jest";
import tsconfigJson from "./tsconfig.json";
const jestUnit: Config = {
verbose: true,
preset: "ts-jest",
testEnvironment: "node",
transform: {
"^.+\\.tsx?$": ["ts-jest", { tsconfig: "<rootDir>/tsconfig.json" }]
},
setupFiles: ["<rootDir>/__tests__/unit/__configs__/jest/globalSetup.ts"],
setupFilesAfterEnv: ["<rootDir>/__tests__/unit/__configs__/jest/setupFilesAfterEnv.ts"],
moduleNameMapper: pathsToModuleNameMapper(tsconfigJson.compilerOptions.paths, {
prefix: "<rootDir>/"
}),
testPathIgnorePatterns: ["<rootDir>/.build/*", "<rootDir>/__tests__/integrations/*"],
collectCoverageFrom: [
"**/**/{!(custom.d),}.ts",
"!**/**/*.spec.ts",
"!**/**/types/*.ts",
"!**/**/src/index.ts",
"!**/**/**/migrate.ts",
"!**/**/**/tables/*.ts",
"!**/**/**/commands/*.ts",
"!services/**/handler.ts",
"!components/middleware/index.ts"
],
coveragePathIgnorePatterns: [
"jest.*",
"<rootDir>/.build/*",
"<rootDir>/*/__tests__/*",
"<rootDir>/__mockutils__/*",
"<rootDir>/components/database/migrations/*",
"local/*",
"<rootDir>/__events__/*"
],
coverageReporters: ["lcov", "text"],
collectCoverage: true,
coverageThreshold: {
global: {
branches: 70,
functions: 75,
lines: 80,
statements: 80
}
},
testResultsProcessor: "jest-sonar-reporter"
};
export default jestUnit;