-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
108 lines (94 loc) · 2.02 KB
/
jest.config.js
File metadata and controls
108 lines (94 loc) · 2.02 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/**
* Jest Configuration for Traversion Test Suite
*
* Configures Jest for ES modules, test environment, and coverage reporting.
*/
export default {
// Test environment
testEnvironment: 'node',
// Enable ES modules support
preset: null,
transform: {},
// Module name mapping for ES modules
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1'
},
// Test file patterns
testMatch: [
'**/test/**/*.test.js',
'**/__tests__/**/*.js',
'**/*.(test|spec).js'
],
// Ignore patterns
testPathIgnorePatterns: [
'/node_modules/',
'/build/',
'/dist/'
],
// Setup files
setupFilesAfterEnv: ['<rootDir>/test/setup.js'],
// Coverage configuration
collectCoverage: true,
coverageDirectory: 'coverage',
coverageReporters: [
'text',
'lcov',
'html',
'clover'
],
// Coverage collection patterns
collectCoverageFrom: [
'src/**/*.js',
'!src/**/*.test.js',
'!src/**/index.js'
],
// Coverage thresholds - increased for better quality assurance
coverageThreshold: {
global: {
branches: 60,
functions: 60,
lines: 65,
statements: 65
},
// Individual file thresholds for critical security modules
'src/auth/authService.js': {
branches: 50,
functions: 55,
lines: 60,
statements: 60
},
'src/middleware/auth.js': {
branches: 50,
functions: 55,
lines: 60,
statements: 60
},
'src/security/secretManager.js': {
branches: 50,
functions: 55,
lines: 60,
statements: 60
},
'src/engine/causalityEngine.js': {
branches: 50,
functions: 60,
lines: 65,
statements: 65
}
},
// Test execution
maxWorkers: '50%',
verbose: true,
// Global timeout (30 seconds)
testTimeout: 30000,
// Reporter configuration
reporters: ['default'],
// Mock configuration
clearMocks: true,
resetMocks: false,
restoreMocks: true,
// Global variables
globals: {
'process.env.NODE_ENV': 'test'
}
};