-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
46 lines (41 loc) · 957 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
39
40
41
42
43
44
45
46
const path = require('path');
const SCOPE = process.env.SCOPE;
const config = {
transform: {
'^.+\\.tsx?$': 'ts-jest'
},
testEnvironment: 'node',
testRegex: 'spec\.ts$',
coverageDirectory: './coverage/',
coveragePathIgnorePatterns: [
'dist',
'\\+internal/testing',
'@integration',
'\\.spec-(util|setup)\\.ts$',
'\\.spec\\.ts$',
'integration\\.ts$'
],
collectCoverageFrom : ['packages/**/*.ts'],
moduleFileExtensions: [
'ts',
'js',
'json'
],
globals: {
'ts-jest': {
tsconfig: path.join(path.dirname(__filename), './tsconfig.test.json'),
diagnostics: {
ignoreCodes: [2300],
},
},
},
};
if (SCOPE === 'integration') {
config.testRegex = 'integration\.spec\.ts$';
console.info('RUNNING INTEGRATION TESTS');
}
if (SCOPE === 'unit') {
config.testRegex = '^((?!integration).)*\.spec\.ts$';
console.info('RUNNING UNIT TESTS');
}
module.exports = config;