-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathjest.config.js
35 lines (33 loc) · 951 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
const MAP_ALIASES = {
"^@src(.*)$": "<rootDir>/src/$1",
"^@test/(.*)$": "<rootDir>/test/$1"
};
const common = {
transform: {
"^.+\\.(t|j)s$": ["ts-jest", { tsconfig: "./test/tsconfig.json" }]
},
rootDir: ".",
moduleNameMapper: {
...MAP_ALIASES
},
setupFiles: ["./test/setup.ts"]
};
module.exports = {
collectCoverageFrom: ["src/**/*.ts", "!src/**/*.spec.ts", "!src/**/*.d.ts", "!src/main.ts", "!src/console.ts", "!src/test/**/*", "!src/**/index.ts"],
projects: [
{
displayName: "unit",
...common,
testMatch: ["<rootDir>/src/**/*.spec.ts"],
setupFilesAfterEnv: ["./test/setup-unit-tests.ts"],
setupFiles: ["./test/setup-unit-env.ts"]
},
{
displayName: "functional",
...common,
testMatch: ["<rootDir>/test/functional/**/*.spec.ts"],
setupFilesAfterEnv: ["./test/setup-functional-tests.ts"],
setupFiles: ["./test/setup-functional-env.ts"]
}
]
};