-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.preset.cjs
56 lines (54 loc) · 1.29 KB
/
jest.preset.cjs
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
const { default: nxPreset } = require('@nx/jest/preset');
const { default: isCI } = require('is-ci');
const esModules = ['@commitlint', 'prettier'].join('|');
module.exports = {
...nxPreset,
collectCoverage: true,
collectCoverageFrom: '**/*.[jt]s?(x)',
coverageDirectory: '<rootDir>/coverage',
coveragePathIgnorePatterns: [
'/coverage/',
'/dist/',
'/e2e/',
'/generated/',
'/node_modules/',
'(.*)\\.d.ts',
'bin.[jt]s',
'index.[jt]s',
'jest.config.ts',
'jest.preset.cjs',
'test-setup.ts'
],
coverageReporters: isCI
? /* istanbul ignore next */
['json', 'text', 'lcovonly', 'cobertura']
: ['text', 'html'],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100
},
'**/*': {
branches: 100,
functions: 100,
lines: 100,
statements: 100
}
},
errorOnDeprecated: true,
moduleFileExtensions: ['js', 'cjs', 'mjs', 'json', 'ts'],
slowTestThreshold: 5,
testTimeout: 20000,
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|test|e2e).[tj]s?(x)'],
testPathIgnorePatterns: [
'/coverage/',
'/dist/',
'/generated/',
'/node_modules/'
],
transformIgnorePatterns: [`node_modules/(?!${esModules}|.*\\.mjs)`],
verbose: true
};