-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathjest.config.cjs
More file actions
35 lines (35 loc) · 975 Bytes
/
jest.config.cjs
File metadata and controls
35 lines (35 loc) · 975 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
/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src', '<rootDir>/tests'],
testMatch: [
'**/__tests__/**/*.ts',
'**/?(*.)+(spec|test).ts'
],
testTimeout: 10000, // 10 seconds timeout for all tests
maxWorkers: 1, // Run tests serially to avoid network conflicts
forceExit: true, // Force Jest to exit after tests complete
transform: {
'^.+\\.ts$': ['ts-jest', {
useESM: false,
tsconfig: {
module: 'commonjs',
experimentalDecorators: true,
emitDecoratorMetadata: true
}
}],
},
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/index.ts',
'!src/utils/wwdc-data-source.ts', // Exclude due to import.meta.url
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov'],
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
};