-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathjest.config.js
More file actions
46 lines (37 loc) · 900 Bytes
/
jest.config.js
File metadata and controls
46 lines (37 loc) · 900 Bytes
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
export default {
// Use ts-jest preset for TypeScript support
preset: 'ts-jest',
// Test environment
testEnvironment: 'node',
// Test file patterns
testMatch: [
'**/test/**/*.test.ts',
'**/test/**/*.spec.ts'
],
// Module file extensions
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
// Transform TypeScript files
transform: {
'^.+\\.ts$': 'ts-jest'
},
// Module name mapping (for clean imports and .js -> .ts resolution)
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^(\\.{1,2}/.*)\\.js$': '$1'
},
// Ignore patterns
testPathIgnorePatterns: [
'/node_modules/',
'/dist/',
'/test/build-output.test.js'
],
// Coverage settings
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts'
],
// Clear mocks between tests
clearMocks: true,
// Verbose output
verbose: true
};