-
Notifications
You must be signed in to change notification settings - Fork 34
/
jest.config.ts
46 lines (43 loc) · 1.21 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
import type {Config} from "@jest/types";
const config: Config.InitialOptions = {
// eslint-disable-next-line unicorn/prefer-module
cacheDirectory: `${__dirname}/.jest_cache`,
roots: ["<rootDir>/src"],
preset: "ts-jest",
testRegex: "(.*.(test|spec)).(jsx?|tsx?|ts?)$",
moduleFileExtensions: ["ts", "js", "json"],
setupFiles: ["./src/testing/preRun.ts"],
collectCoverage: true,
transform: {
"^.+\\.(tsx?|ts?)$": ["ts-jest", {tsconfig: `tsconfig.test.json`}],
},
silent: false,
verbose: true,
collectCoverageFrom: [
"**/src/**/*.ts",
"!**/node_modules/**",
"!**/*.test.data.ts",
],
coverageThreshold: {
global: {
statements: 0,
branches: 0,
functions: 0,
lines: 0,
},
},
reporters: [
"default",
[
"jest-junit",
{
outputName: "junit-TEST.xml",
},
],
],
coveragePathIgnorePatterns: [
".*test\\.data\\.ts$,migrations.*.ts$,(.*.(test|spec)).(jsx?|tsx?)$,(tests/.*.mock).(jsx?|tsx?)$",
],
coverageReporters: ["json", "lcov", "text", "clover", "cobertura"],
};
export default config;