-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
57 lines (53 loc) · 1.29 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
const sharedConfigs = {
transform: {
'\\.[jt]sx?$': 'babel-jest',
'\\.mjs?$': 'babel-jest',
},
moduleNameMapper: {
'\\.(css|scss)$': 'identity-obj-proxy',
'^app/(.*)$': '<rootDir>/app/$1',
'^pages/(.*)$': '<rootDir>/pages/$1',
},
};
const appConfig = {
displayName: 'App Tests',
testMatch: [
'<rootDir>/app/**/__tests__/**/*.[jt]s?(x)',
'<rootDir>/app/**/?(*.)+(spec|test).[jt]s?(x)',
'<rootDir>/pages/**/__tests__/**/*.[jt]s?(x)',
'<rootDir>/pages/**/?(*.)+(spec|test).[jt]s?(x)',
],
testEnvironment: 'jsdom',
...sharedConfigs,
};
const clientConfig = {
displayName: 'Client Tests',
testMatch: [
'<rootDir>/client/**/__tests__/**/*.[jt]s?(x)',
'<rootDir>/client/**/?(*.)+(spec|test).[jt]s?(x)',
],
testEnvironment: 'jsdom',
...sharedConfigs,
};
const serverConfig = {
displayName: 'Server Tests',
testMatch: [
'<rootDir>/server/**/__tests__/**/*.[jt]s?(x)',
'<rootDir>/server/**/?(*.)+(spec|test).[jt]s?(x)',
],
testEnvironment: 'node',
...sharedConfigs,
};
module.exports = {
projects: [clientConfig, serverConfig, appConfig],
collectCoverage: true,
coverageDirectory: '__coverage__',
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
};