forked from AgesEmpire/StellarSwipe-Backends
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
91 lines (90 loc) · 2.5 KB
/
Copy pathjest.config.js
File metadata and controls
91 lines (90 loc) · 2.5 KB
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
// Contract tests run in a dedicated Jest project so they can be excluded from
// the unit/integration coverage sweep and run independently in CI:
// jest --selectProjects unit – fast unit tests only
// jest --selectProjects contracts – consumer + provider pact tests only
// jest – everything
module.exports = {
projects: [
{
displayName: 'unit',
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: '.',
testRegex: '^(?!.*test/contracts/).*\\.spec\\.ts$',
transform: { '^.+\\.(t|j)s$': 'ts-jest' },
testEnvironment: 'node',
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
moduleNameMapper: {
'^src/(.*)$': '<rootDir>/src/$1',
'^test/(.*)$': '<rootDir>/test/$1',
},
},
{
displayName: 'contracts',
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: '.',
testRegex: 'test/contracts/.*\\.spec\\.ts$',
transform: { '^.+\\.(t|j)s$': 'ts-jest' },
testEnvironment: 'node',
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
moduleNameMapper: {
'^src/(.*)$': '<rootDir>/src/$1',
'^test/(.*)$': '<rootDir>/test/$1',
},
testTimeout: 120_000,
},
],
// Coverage is collected only from the unit project
collectCoverageFrom: [
'src/**/*.(t|j)s',
'!src/**/*.spec.ts',
'!src/**/*.interface.ts',
'!src/**/*.dto.ts',
'!src/**/*.entity.ts',
'!src/**/*.module.ts',
'!src/main.ts',
'!src/**/*.config.ts',
'!src/migrations/**',
],
coverageDirectory: './coverage',
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
// Legacy defaults (used when no --selectProjects flag is passed)
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: '.',
testRegex: '.*\\.spec\\.ts$',
transform: {
'^.+\\.(t|j)s$': 'ts-jest',
},
collectCoverageFrom: [
'src/**/*.(t|j)s',
'!src/**/*.spec.ts',
'!src/**/*.interface.ts',
'!src/**/*.dto.ts',
'!src/**/*.entity.ts',
'!src/**/*.module.ts',
'!src/main.ts',
'!src/**/*.config.ts',
'!src/migrations/**',
],
coverageDirectory: './coverage',
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
testEnvironment: 'node',
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
moduleNameMapper: {
'^src/(.*)$': '<rootDir>/src/$1',
'^test/(.*)$': '<rootDir>/test/$1',
},
};