-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
43 lines (40 loc) · 1.17 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
import type { Config } from "jest";
import * as path from "path";
export const jestOutPutDir = () => {
return path.resolve(__dirname, "test", "reports");
};
export default async (): Promise<Config> => {
const coverageDir = path.resolve(__dirname, "test", "coverage");
const rootDir = path.resolve(__dirname, "src");
return {
rootDir,
coverageDirectory: coverageDir,
verbose: true,
collectCoverage: true,
setupFilesAfterEnv: [path.resolve(__dirname, "./test/jest.setup.ts")],
moduleFileExtensions: ["js", "json", "ts"],
testRegex: ".*\\.spec\\.ts$",
transform: {
"^.+\\.(t|j)s$": "ts-jest",
},
testResultsProcessor: "jest-junit",
collectCoverageFrom: ["**/**.(t|j)s"],
reporters: [
"default",
[
"jest-junit",
{
suiteName: `jest tests`,
outputDirectory: jestOutPutDir(),
outputName: `junit.xml`,
uniqueOutputName: "false",
classNameTemplate: "{classname}-{title}",
titleTemplate: "{classname}-{title}",
ancestorSeparator: " › ",
usePathForSuiteName: "true",
},
],
],
testEnvironment: "node",
};
};