-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
95 lines (93 loc) · 2.35 KB
/
jest.config.ts
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
* @type {import('jest').Config}
*/
const config: import('jest').Config = {
testTimeout: 30000,
fakeTimers: {
doNotFake: ['nextTick'],
timerLimit: 30000,
},
bail: 1,
verbose: true,
coverageProvider: 'v8',
collectCoverage: true,
coverageDirectory: 'coverage',
coverageReporters: ['clover', 'json', 'lcov', ['text', { skipFull: true }]],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: -10,
},
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node', 'mjs'],
transformIgnorePatterns: ['node_modules/(?!@angular/core)'],
projects: [
{
displayName: 'esLint',
clearMocks: false,
globals: {
__DEV__: true,
},
moduleFileExtensions: ['ts', 'json'],
runner: 'jest-runner-eslint',
testRegex: '(/tests/.*|(\\.|/)(test|spec))\\.(mjs?|js?|tsx?|ts?)$',
transform: {},
},
{
displayName: 'prettier',
clearMocks: true,
globals: {
__DEV__: true,
},
preset: 'jest-runner-prettier',
runner: 'prettier',
testPathIgnorePatterns: [
'<rootDir>/dist/',
'<rootDir>/node_modules/',
'<rootDir>/docs/',
'<rootDir>/logs/',
'<rootDir>/coverage/',
],
transform: {},
moduleFileExtensions: ['js', 'ts', 'css', 'less', 'scss', 'html', 'json', 'graphql', 'md', 'yaml'],
testMatch: [
'**/*',
'**/*.ts',
'**/*.css',
'**/*.less',
'**/*.scss',
'**/*.html',
'**/*.json',
'**/*.graphql',
'**/*.md',
'**/*.yaml',
],
},
{
displayName: 'ts-jest',
clearMocks: false,
globals: {
__DEV__: true,
},
moduleFileExtensions: ['js', 'ts', 'yaml', 'json', 'mjs'],
preset: 'ts-jest',
testPathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/docs/',
'<rootDir>/dist/',
'<rootDir>/logs/',
'<rootDir>/coverage/',
],
testRegex: '(/.*|(\\.|/)(test|spec))\\.(mjs?|cjs?|js?|tsx?|ts?)$',
transform: {
'^.+\\.ts?$': 'ts-jest',
},
transformIgnorePatterns: ['node_modules/(?!@angular/core)'],
},
],
}
export default config