-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
86 lines (77 loc) · 1.76 KB
/
jest.config.js
File metadata and controls
86 lines (77 loc) · 1.76 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
/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
// Test file patterns
roots: ['<rootDir>/tests'],
testMatch: [
'**/__tests__/**/*.test.ts',
'**/__tests__/**/*.spec.ts',
'**/tests/**/*.test.ts',
'**/tests/**/*.spec.ts'
],
testPathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/dist/',
'<rootDir>/coverage/'
],
// TypeScript transformation
transform: {
'^.+\\.tsx?$': ['ts-jest', {
tsconfig: 'tsconfig.lint.json'
}]
},
// Module resolution
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@/types/(.*)$': '<rootDir>/src/types/$1',
'^@/core/(.*)$': '<rootDir>/src/core/$1',
'^@/providers/(.*)$': '<rootDir>/src/providers/$1',
'^@/utils/(.*)$': '<rootDir>/src/utils/$1'
},
// Coverage configuration
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/**/*.test.ts',
'!src/**/*.spec.ts',
'!src/**/index.ts',
'!src/utils/RateLimiter.ts', // Excluded: causes test hangs, needs refactoring
'!tests/**/*'
],
coverageDirectory: 'coverage',
coverageReporters: [
'text',
'text-summary',
'lcov',
'html',
'json'
],
coverageThreshold: {
global: {
branches: 70,
functions: 90,
lines: 80,
statements: 80
}
},
// Test environment
testTimeout: 10000,
verbose: false,
detectOpenHandles: false,
detectLeaks: false,
// Setup files
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
// Error handling
errorOnDeprecated: true,
// Performance
maxWorkers: '50%',
// Reporter configuration
reporters: [
'default',
['jest-junit', {
outputDirectory: 'coverage',
outputName: 'junit.xml'
}]
]
};