forked from dipseth/dataproc-mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
90 lines (75 loc) · 1.55 KB
/
jest.config.js
File metadata and controls
90 lines (75 loc) · 1.55 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
/** @type {import('jest').Config} */
export default {
// Test environment
testEnvironment: 'node',
// TypeScript support
preset: 'ts-jest/presets/default-esm',
extensionsToTreatAsEsm: ['.ts'],
// Module resolution
moduleNameMapping: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
// Test file patterns
testMatch: [
'**/tests/**/*.test.ts',
'**/tests/**/*.spec.ts'
],
// Coverage configuration
collectCoverage: false, // Enable only when needed
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/types/**',
'!src/**/*.test.ts',
'!src/**/*.spec.ts'
],
coverageDirectory: 'coverage',
coverageReporters: [
'text',
'text-summary',
'html',
'lcov'
],
// Coverage thresholds
coverageThreshold: {
global: {
branches: 90,
functions: 90,
lines: 90,
statements: 90
}
},
// Setup files
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
// Test timeout
testTimeout: 30000,
// Transform configuration
transform: {
'^.+\\.ts$': ['ts-jest', {
useESM: true,
tsconfig: {
module: 'esnext'
}
}]
},
// Module file extensions
moduleFileExtensions: ['ts', 'js', 'json'],
// Ignore patterns
testPathIgnorePatterns: [
'/node_modules/',
'/build/',
'/dist/'
],
// Clear mocks between tests
clearMocks: true,
// Verbose output
verbose: true,
// Error handling
errorOnDeprecated: true,
// Global variables
globals: {
'ts-jest': {
useESM: true
}
}
};