-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
39 lines (39 loc) · 1.03 KB
/
jest.config.js
File metadata and controls
39 lines (39 loc) · 1.03 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
// jest.config.js
export default {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
setupFilesAfterEnv: ['<rootDir>/test/setup.js'],
clearMocks: true,
resetMocks: true,
restoreMocks: true,
testMatch: [
'<rootDir>/test/**/*.test.js'
],
testPathIgnorePatterns: [
'<rootDir>/dist/',
'<rootDir>/node_modules/'
],
collectCoverageFrom: [
'src/**/*.{js,ts}',
'!src/server.{js,ts}',
'!**/node_modules/**'
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],
testTimeout: 10000,
forceExit: true,
detectOpenHandles: true,
transform: {
'^.+\\.ts$': ['ts-jest', {
useESM: true
}]
},
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^../src/(.*)\.js$': '<rootDir>/src/$1.ts',
'^../services/(.*)\.js$': '<rootDir>/src/services/$1.ts',
'^../utils/(.*)\.js$': '<rootDir>/src/utils/$1.ts',
'^../infrastructure/(.*)\.js$': '<rootDir>/src/infrastructure/$1.ts',
'^../auth\\.config\\.js$': '<rootDir>/src/auth.config.ts'
}
};