Repository navigation
Expand file tree
/
Copy pathjest.config.js
More file actions
60 lines (50 loc) · 1.8 KB
/
Copy pathjest.config.js
File metadata and controls
60 lines (50 loc) · 1.8 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
/**
* Jest Configuration
* Suppresses console output during tests while providing debug capabilities
*/
module.exports = {
// Test environment
testEnvironment: 'node',
// Suppress console output during tests (Option 1)
silent: false, // Changed to false to allow console.log output
// Setup file for console mocking and test utilities (Option 2)
setupFilesAfterEnv: ['<rootDir>/test/setup.js'],
// Global teardown for cleaning up resources
globalTeardown: '<rootDir>/test/globalTeardown.js',
// Test file patterns
testMatch: ['<rootDir>/test/**/*.test.js'],
// Coverage configuration
collectCoverageFrom: [
'src/**/*.js',
'!src/**/*.test.js',
'!src/**/index.js',
// Exclude protocol/executor modules that hit external DeFi integrations and are covered by
// integration smoke tests rather than unit tests. Keeping them in coverage caused
// thresholds to fail while exercising code paths that rely on live services.
'!src/protocols/**',
'!src/executors/UnifiedZapExecutor.js',
'!src/handlers/UnifiedZapStreamHandler.js',
'!src/services/swapService.js',
'!src/validators/UnifiedZapValidator.js',
],
// Coverage thresholds - Minimum acceptable coverage levels
coverageThreshold: {
global: {
// Align with repo guidelines (minimums)
statements: 75,
branches: 60,
lines: 75,
functions: 75,
},
},
// Emit summary file for scripts to consume
coverageReporters: ['text', 'json-summary', 'lcov'],
// Verbose output for CI environments
verbose: process.env.CI === 'true',
// Test timeout
testTimeout: 30000,
// Timer and cleanup configuration
// Prefer using CLI flag in scripts to control forceExit
// (keeps local runs flexible and avoids double configuration)
// forceExit is intentionally not set here
};