forked from ScribeMD/docker-cache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
38 lines (34 loc) · 913 Bytes
/
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
import type { JestConfigWithTsJest } from "ts-jest";
const config: JestConfigWithTsJest = {
collectCoverage: true,
coverageDirectory: "reports/jest/",
coverageProvider: "v8",
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
extensionsToTreatAsEsm: [".ts"],
moduleFileExtensions: ["ts", "js"],
resetMocks: true,
rootDir: "../src",
// See https://kulshekhar.github.io/ts-jest/docs/guides/esm-support#use-esm-presets.
preset: "ts-jest/presets/default-esm",
transform: {
"^.+\\.ts$": ["ts-jest", { useESM: true }],
},
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
};
if (process.env["CI"] === "true") {
config.ci = true;
config.collectCoverageFrom = ["**/*.ts"];
config.reporters = [
["jest-junit", { outputDirectory: "<rootDir>/reports/jest/" }],
];
}
export default config;