-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
33 lines (32 loc) · 988 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
/* eslint-disable no-process-env, id-match */
const isCI = Boolean(process.env.CI);
const watchMode = process.argv.indexOf('--watchAll') !== -1 || process.argv.indexOf('--watch') !== -1;
const forceCoverage = process.argv.indexOf('--coverage') !== -1;
const coverageReporters = isCI ? ['json', 'cobertura', 'text', 'html', 'lcov'] : ['text-summary', 'html', 'text'];
const reporters = isCI ? ['default', ['jest-junit', {
suiteName: 'jest',
output: './reports/jest/results.xml'}
]] : ['default'];
module.exports = {
clearMocks: true,
cacheDirectory: './node_modules/.cache/jest',
collectCoverage: isCI || forceCoverage || !watchMode,
reporters,
coverageReporters,
coveragePathIgnorePatterns: [
'jest.config.js'
],
coverageDirectory: './coverage',
coverageThreshold: {
global: {
lines: 0,
branches: 0,
functions: 0,
statements: 0
}
},
snapshotSerializers: [
'jest-snapshot-serializer-function-name'
],
verbose: true
};