-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
39 lines (39 loc) · 1.32 KB
/
Copy pathjest.config.js
File metadata and controls
39 lines (39 loc) · 1.32 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
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src'],
testMatch: ['**/__tests__/**/*.test.ts', '**/__tests__/**/*.spec.ts', '**/?(*.)+(spec|test).ts'],
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/src/__tests__/jest.setup.ts', '/src/__tests__/test-helpers.ts'],
testTimeout: 60000,
// Use more workers for faster parallel execution (use 100% of CPU cores)
// In CI, this can be overridden with --maxWorkers flag
maxWorkers: process.env.CI ? '100%' : '75%',
// Enable test result caching for faster re-runs
cache: true,
cacheDirectory: '<rootDir>/.jest-cache',
globalSetup: '<rootDir>/src/__tests__/global-setup.ts',
setupFilesAfterEnv: ['<rootDir>/src/__tests__/jest.setup.ts'],
// Only collect coverage when explicitly requested (speeds up CI)
collectCoverage: process.env.COLLECT_COVERAGE === 'true',
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/**/*.test.ts',
'!src/**/*.spec.ts'
],
moduleFileExtensions: ['ts', 'js', 'json'],
transform: {
'^.+\\.ts$': 'ts-jest'
},
reporters: [
'default',
['jest-junit', {
outputDirectory: '.',
outputName: 'junit.xml'
}]
],
// Fail fast on first error in CI (saves time)
bail: process.env.CI ? 1 : false,
// Show more useful output
verbose: false
};