11import type { Config } from 'jest' ;
22
33const config : Config = {
4- 'preset' : 'ts-jest' ,
5- 'testEnvironment' : 'node' ,
6- 'roots' : [ '<rootDir>/src' , '<rootDir>/test' ] ,
7- 'testMatch' : [ '**/*.spec.ts' , '**/*.test.ts' ] ,
8- 'collectCoverageFrom' : [
9- 'src/**/*.ts' ,
10- '!src/**/*.d.ts'
11- ] ,
12- 'coverageDirectory' : 'coverage' ,
13- 'coverageReporters' : [ 'text-summary' , 'html' , 'lcov' ]
4+ preset : 'ts-jest' ,
5+ testEnvironment : 'node' ,
6+ roots : [ '<rootDir>/src' , '<rootDir>/test' ] ,
7+
8+ // Test file patterns
9+ testMatch : [ '**/test/**/*.spec.ts' ] ,
10+
11+ // TypeScript configuration
12+ transform : {
13+ '^.+\\.ts$' : 'ts-jest'
14+ } ,
15+
16+ // Module file extensions
17+ moduleFileExtensions : [ 'ts' , 'js' , 'json' ] ,
18+
19+ // Setup Jest types globally
20+ setupFilesAfterEnv : [ ] ,
21+
22+ // Coverage configuration
23+ collectCoverageFrom : [ 'src/**/*.ts' , '!src/**/*.d.ts' , '!src/**/*.spec.ts' , '!src/**/*.test.ts' ] ,
24+
25+ // Coverage output directory
26+ coverageDirectory : 'coverage' ,
27+
28+ // Coverage reporters
29+ coverageReporters : [ 'lcov' , 'html' , 'text' , 'text-summary' ] ,
30+
31+ // Coverage thresholds (optional)
32+ coverageThreshold : {
33+ global : {
34+ branches : 80 ,
35+ functions : 80 ,
36+ lines : 80 ,
37+ statements : 80
38+ }
39+ } ,
40+
41+ // Clear mocks between tests
42+ clearMocks : true ,
43+
44+ // Verbose output
45+ // verbose: true,
46+
47+ // Exit on test failure
48+ // forceExit: true,
49+
50+ // Timeout for tests (30 seconds like mocha config)
51+ testTimeout : 30000
1452} ;
1553
16- export default config ;
54+ export default config ;
0 commit comments