-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
38 lines (38 loc) · 1.2 KB
/
jest.config.ts
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
module.exports = {
preset: 'ts-jest',
roots: ['<rootDir>'],
testEnvironment: 'node',
testPathIgnorePatterns: ['node_modules/*', 'dist/*'],
moduleFileExtensions: ['ts', 'js'],
transform: {
'^.+\\.ts$': 'ts-jest',
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.jsx?$': 'babel-jest',
},
restoreMocks: true,
resetMocks: true,
coverageDirectory: '<rootDir>/coverage',
coverageReporters: ['text-summary', 'lcov'],
reporters: ['default', 'jest-junit'],
coveragePathIgnorePatterns: ['node_modules', 'test'],
clearMocks: true,
moduleNameMapper: {
'^@/(.*)': ['<rootDir>/src/$1'],
'^@application/(.*)': ['<rootDir>/src/application/$1'],
'^@contexts/(.*)': ['<rootDir>/src/contexts/$1'],
'^@shared/(.*)': ['<rootDir>/src/contexts/shared/$1'],
'^@test/(.*)': ['<rootDir>/test/$1'],
'@infrastructure/(.*)': ['<rootDir>/src/shared/infrastructure/$1'],
},
collectCoverageFrom: [
'<rootDir>/src/**',
'!**/node_modules/**',
'!<rootDir>/src/**.ts',
'!<rootDir>/src/**/dto/**',
'!<rootDir>/src/**/types/**',
'!<rootDir>/src/**/model/**',
'!<rootDir>/src/**/infrastructure/**.ts',
],
setupFiles: ['<rootDir>/jest.setup.js'],
testMatch: ['**/*.spec.ts'],
};