-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.integration.config.ts
More file actions
52 lines (49 loc) · 1.46 KB
/
jest.integration.config.ts
File metadata and controls
52 lines (49 loc) · 1.46 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
40
41
42
43
44
45
46
47
48
49
50
51
52
import type { Config } from 'jest';
const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/tests'],
transformIgnorePatterns: [
'node_modules/(?!(@faker-js/faker)/)',
],
testMatch: ['**/tests/integration/**/*.test.ts'],
transform: {
'^.+\\.ts$': ['ts-jest', {
tsconfig: 'tsconfig.test.json',
}],
},
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/server.ts',
'!src/types/**',
],
coverageDirectory: 'coverage-integration',
coverageReporters: ['text', 'lcov', 'html'],
coverageThreshold: {
global: {
branches: 70,
functions: 75,
lines: 80,
statements: 80,
},
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@config/(.*)$': '<rootDir>/src/config/$1',
'^@middleware/(.*)$': '<rootDir>/src/middleware/$1',
'^@routes/(.*)$': '<rootDir>/src/routes/$1',
'^@controllers/(.*)$': '<rootDir>/src/controllers/$1',
'^@services/(.*)$': '<rootDir>/src/services/$1',
'^@models/(.*)$': '<rootDir>/src/models/$1',
'^@utils/(.*)$': '<rootDir>/src/utils/$1',
},
setupFilesAfterEnv: ['<rootDir>/tests/integration/setup.ts'],
testTimeout: 30000,
verbose: true,
// Worker process configuration
maxWorkers: 1, // Run tests serially to avoid connection pool issues
forceExit: true, // Force exit after tests complete
detectOpenHandles: true, // Help identify what's keeping the process alive
};
export default config;