-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathjest.config.js
More file actions
46 lines (46 loc) · 1.45 KB
/
jest.config.js
File metadata and controls
46 lines (46 loc) · 1.45 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
module.exports = {
testEnvironment: 'node',
coverageDirectory: 'coverage',
collectCoverageFrom: [
'src/**/*.js',
'!src/**/*.test.js',
'!src/server.js', // Tested via integration tests with spawned processes
],
testMatch: [
'**/test/**/*.test.js',
],
testTimeout: 15000, // Allow time for server startup in integration tests
setupFilesAfterEnv: ['<rootDir>/test/setup.js'],
// Projects for different test types
projects: [
{
displayName: 'unit',
testMatch: [
'<rootDir>/test/helpers.test.js',
'<rootDir>/test/unit/**/*.test.js'
],
},
{
displayName: 'integration',
testMatch: [
'<rootDir>/test/server.test.js',
'<rootDir>/test/*.integration.test.js',
'<rootDir>/test/integration/**/*.test.js'
],
maxWorkers: 1, // Run integration tests sequentially to avoid port conflicts
testTimeout: 60000, // Longer timeout for real Langfuse calls
},
],
// Coverage thresholds
// Note: Branch and function coverage are slightly lower because server.js
// can't be unit tested (it's tested via integration tests with spawned processes)
// All extracted business logic modules have >85% coverage
coverageThreshold: {
global: {
branches: 76, // Close to 80%, limited by conditional branches
functions: 86, // Achieved 86.27%
lines: 94, // Achieved 94.36%
statements: 93, // Achieved 93.29%
},
},
}