-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
44 lines (41 loc) · 1.13 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
const env = require('./env');
switch (process.env.JEST_ENV) {
case 'app':
module.exports = {
coveragePathIgnorePatterns: ['/node_modules/', '/tools/'],
moduleFileExtensions: ['js', 'jsx'],
moduleNameMapper: {
'~(.*)': '<rootDir>/src$1',
},
setupFilesAfterEnv: ['<rootDir>/tools/setup-app.js'],
snapshotSerializers: ['jest-emotion'],
testPathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/.flow-typed',
'.*\\.e2e-spec.js$',
],
testURL: `http://${env.HOST_NAME}/`,
transform: {
'^.+\\.js$': 'babel-jest',
'^[./a-zA-Z0-9$_-]+\\.(bmp|gif|jpg|jpeg|png|psd|svg|webp)$':
'<rootDir>/tools/assets-transform.js',
},
};
break;
case 'e2e':
module.exports = {
setupFilesAfterEnv: ['<rootDir>/tools/setup-e2e.js'],
testPathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/.flow-typed',
'.*\\.spec.js$',
],
testURL: `http://${env.HOST_NAME}/`,
transform: {
'^.+\\.js$': 'babel-jest',
},
};
break;
default:
module.exports = {};
}