-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
80 lines (63 loc) · 1.62 KB
/
jest.config.js
File metadata and controls
80 lines (63 loc) · 1.62 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
module.exports = {
// Test environment
testEnvironment: 'node',
// File extensions to look for
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
// Transform files with ts-jest
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
// Test file patterns - only backend tests
testMatch: [
'**/src/**/__tests__/**/*.(ts|tsx|js)',
'**/src/**/*.(test|spec).(ts|tsx|js)',
],
// Coverage configuration - only backend files
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/test/**',
'!**/node_modules/**',
'!frontend/**',
],
// Coverage thresholds
coverageThreshold: {
global: {
branches: 70,
functions: 70,
lines: 70,
statements: 70,
},
},
// Coverage reporters
coverageReporters: ['text', 'lcov', 'html'],
// Setup files
setupFilesAfterEnv: ['<rootDir>/src/test/setup.ts'],
// Module name mapping
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
// Test timeout
testTimeout: 10000,
// Clear mocks between tests
clearMocks: true,
// Restore mocks between tests
restoreMocks: true,
// Verbose output
verbose: true,
// Force exit after tests
forceExit: true,
// Detect open handles
detectOpenHandles: true,
// Test path ignore patterns
testPathIgnorePatterns: [
'/node_modules/',
'/frontend/',
],
// Transform ignore patterns - exclude node-fetch from transformation
transformIgnorePatterns: [
'node_modules/(?!(zod|@apollo|graphql)/)',
],
// Module file extensions
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
};