-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
55 lines (43 loc) · 1.05 KB
/
Copy pathjest.config.js
File metadata and controls
55 lines (43 loc) · 1.05 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
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src', '<rootDir>/test'],
// Test file patterns
testMatch: ['**/test/**/*.spec.ts'],
// TypeScript configuration
transform: {
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.jest.json'
}
]
},
// Module file extensions
moduleFileExtensions: ['ts', 'js', 'json'],
// Setup Jest types globally
setupFilesAfterEnv: [],
// Coverage configuration
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts', '!src/**/*.spec.ts', '!src/**/*.test.ts'],
// Coverage output directory
coverageDirectory: 'coverage',
// Coverage reporters
coverageReporters: ['lcov', 'html', 'text', 'text-summary'],
// Coverage thresholds (optional)
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80
}
},
// Clear mocks between tests
clearMocks: true,
// Verbose output
// verbose: true,
// Exit on test failure
// forceExit: true,
// Timeout for tests (30 seconds like mocha config)
testTimeout: 30000
};