forked from dittofeed/dittofeed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
74 lines (71 loc) · 1.72 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
const { defaults: tsjPreset } = require("ts-jest/presets");
const BASE_CONFIG = {
clearMocks: true,
transform: {
...tsjPreset.transform,
},
setupFilesAfterEnv: ["jest-expect-message"],
};
const config = {
testEnvironment: "node",
projects: [
{
...BASE_CONFIG,
globalTeardown: "<rootDir>/packages/backend-lib/test/globalTeardown.ts",
globalSetup: "<rootDir>/packages/backend-lib/test/globalSetup.ts",
displayName: "backend-lib",
roots: ["<rootDir>/packages/backend-lib/src"],
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
tsconfig: "<rootDir>/packages/backend-lib/tsconfig.jest.json",
},
],
},
},
{
...BASE_CONFIG,
displayName: "dashboard",
roots: ["<rootDir>/packages/dashboard/src"],
moduleNameMapper: {
"\\.css$": "<rootDir>/packages/dashboard/test/__mocks__/styleMock.ts",
},
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
tsconfig: "<rootDir>/packages/dashboard/tsconfig.jest.json",
},
],
},
},
{
...BASE_CONFIG,
displayName: "api",
roots: ["<rootDir>/packages/api/src"],
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
tsconfig: "<rootDir>/packages/api/tsconfig.json",
},
],
},
},
{
...BASE_CONFIG,
displayName: "isomorphic-lib",
roots: ["<rootDir>/packages/isomorphic-lib/src"],
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
tsconfig: "<rootDir>/packages/dashboard/tsconfig.jest.json",
},
],
},
},
],
};
module.exports = config;