-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
33 lines (31 loc) · 1.05 KB
/
jest.config.js
File metadata and controls
33 lines (31 loc) · 1.05 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
const { createDefaultPreset } = require("ts-jest");
const tsJestTransformCfg = createDefaultPreset().transform;
/** @type {import("jest").Config} **/
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/tests'],
testMatch: ['**/*.test.ts'],
collectCoverageFrom: [
'src/**/*.{ts,js}',
'!src/**/*.d.ts',
],
// Memory and performance optimizations
maxWorkers: 1, // Run tests serially to avoid resource conflicts
testTimeout: 180000, // 3 minutes timeout
// Cleanup configuration
clearMocks: true,
resetMocks: true,
restoreMocks: true,
// Force exit to prevent hanging
forceExit: true,
// Detect open handles for debugging
detectOpenHandles: false, // Disable by default, enable for debugging
// Memory management
logHeapUsage: false, // Enable for debugging memory issues
// Global setup and teardown
globalSetup: '<rootDir>/tests/setup/globalSetup.js',
globalTeardown: '<rootDir>/tests/setup/globalTeardown.js',
// Setup files
setupFilesAfterEnv: ['<rootDir>/tests/setup/testSetup.js'],
};