-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
91 lines (73 loc) · 1.93 KB
/
jest.config.js
File metadata and controls
91 lines (73 loc) · 1.93 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
/** @type {import('jest').Config} */
module.exports = {
// Test environment
testEnvironment: 'node',
// Test match patterns
testMatch: ['**/tests/**/*.test.{js,ts}', '**/__tests__/**/*.test.{js,ts}', '**/*.spec.{js,ts}'],
// Coverage configuration
collectCoverage: false, // Enable with --coverage flag
collectCoverageFrom: [
'server/src/**/*.{js,ts}',
'server/server.js',
'scripts/**/*.{js,ts}',
'etl/**/*.ts',
'!**/node_modules/**',
'!**/tests/**',
'!**/__tests__/**',
'!**/coverage/**',
],
// Coverage thresholds
coverageThreshold: {
global: {
branches: 60,
functions: 60,
lines: 60,
statements: 60,
},
},
// Coverage reporters
coverageReporters: ['text', 'text-summary', 'html', 'lcov', 'json'],
// Coverage directory
coverageDirectory: 'coverage',
// Setup files
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
// Module paths
modulePaths: ['<rootDir>'],
// Clear mocks between tests
clearMocks: true,
resetMocks: true,
restoreMocks: true,
// Verbose output
verbose: true,
// Timeout
testTimeout: 30000,
// Ignore patterns
testPathIgnorePatterns: [
'/node_modules/',
'/data/',
'/docs/',
'/scripts/manual/',
'<rootDir>/client/',
'/client/',
'<rootDir>/.claude/',
'__tests__',
],
modulePathIgnorePatterns: ['<rootDir>/.claude/'],
// Transform - Add TypeScript support
preset: 'ts-jest',
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.test.json' }],
'^.+\\.js$': 'babel-jest',
},
// Module file extensions
moduleFileExtensions: ['js', 'ts', 'tsx', 'json'],
// Global setup/teardown
globalSetup: '<rootDir>/tests/globalSetup.js',
globalTeardown: '<rootDir>/tests/globalTeardown.js',
// Force exit after tests
forceExit: true,
// Detect open handles
detectOpenHandles: true,
// Max workers for parallel execution
maxWorkers: '50%',
};