-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
66 lines (63 loc) · 1.65 KB
/
Copy pathjest.config.js
File metadata and controls
66 lines (63 loc) · 1.65 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
/** @type {import('ts-jest').JestConfigWithTsJest} */
const sharedConfig = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.ts$': 'ts-jest',
},
};
module.exports = {
verbose: true,
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/**/*.test.ts',
'!src/**/__tests__/**',
// Entry points and barrel re-exports
'!src/index.ts',
'!src/api/index.ts',
'!src/schemas/index.ts',
'!src/utils/index.ts',
'!src/utils/validators/index.ts',
'!src/validators/index.ts',
// Generated files
'!src/rules/rule-ids.ts',
'!src/rules/index.ts',
// CLI (tested via integration tests, not unit tests)
'!src/cli.ts',
'!src/cli/commands/**',
'!src/cli/init-wizard.ts',
'!src/cli/config-debug.ts',
'!src/cli/utils/logger.ts',
'!src/cli/utils/config-loader.ts',
'!src/cli/utils/system-tools.ts',
'!src/cli/utils/formatters/**',
],
coverageThreshold: {
global: {
branches: 70,
functions: 80,
lines: 80,
statements: 80,
},
},
coverageDirectory: 'coverage',
projects: [
{
...sharedConfig,
displayName: 'unit',
roots: ['<rootDir>/src', '<rootDir>/tests'],
testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],
testPathIgnorePatterns: ['<rootDir>/tests/integration/'],
},
{
...sharedConfig,
displayName: 'integration',
roots: ['<rootDir>/tests/integration'],
testMatch: ['**/?(*.)+(spec|test).ts'],
// Run integration tests sequentially -- they spawn CLI subprocesses
// that compete for CPU when run in parallel
maxWorkers: 1,
},
],
};