forked from akash-network/console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
38 lines (36 loc) · 924 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
36
37
38
const MAP_ALIASES = {
"^@src(.*)$": "<rootDir>/src/$1",
"^@test/(.*)$": "<rootDir>/test/$1",
"^@shared/(.*)$": "<rootDir>/../shared/$1"
};
const MAP_TO_SAME_SEQUELIZE_PACKAGE = {
"^sequelize(.*)$": "<rootDir>/node_modules/sequelize$1"
};
const common = {
transform: {
"^.+\\.(t|j)s$": ["ts-jest", { tsconfig: "./tsconfig.json" }]
},
rootDir: ".",
moduleNameMapper: {
...MAP_ALIASES,
...MAP_TO_SAME_SEQUELIZE_PACKAGE
},
setupFiles: ["./test/setup.ts"]
};
module.exports = {
collectCoverageFrom: ["./src/**/*.{js,ts}"],
projects: [
{
displayName: "unit",
...common,
testMatch: ["<rootDir>/src/**/*.spec.ts"],
setupFilesAfterEnv: ["./test/setup-unit-tests.ts"]
},
{
displayName: "functional",
...common,
testMatch: ["<rootDir>/test/functional/**/*.spec.ts"],
setupFilesAfterEnv: ["./test/setup-functional-tests.ts"]
}
]
};