-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjest.integration.config.js
More file actions
78 lines (63 loc) · 1.85 KB
/
jest.integration.config.js
File metadata and controls
78 lines (63 loc) · 1.85 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/** @type {import('jest').Config} */
const config = {
// Use the same preset as main tests
preset: 'ts-jest',
testEnvironment: 'node',
// Only run integration tests
testMatch: ['<rootDir>/test/integration/**/*.test.ts'],
// Global setup and teardown
globalSetup: '<rootDir>/test/integration/setup.ts',
globalTeardown: '<rootDir>/test/integration/teardown.ts',
// Setup after environment
setupFilesAfterEnv: ['<rootDir>/test/integration/setupAfterEnv.ts'],
// Optimized timeout for integration tests
testTimeout: 15000, // Reduced from 30000
// Coverage settings
collectCoverage: false, // Disable coverage for integration tests
// Module resolution
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^uuid$': '<rootDir>/test/__mocks__/uuid.js',
},
// Transform settings
transform: {
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: 'tsconfig.json',
},
],
},
// Optimize output for integration tests
verbose: false, // Reduced verbosity for speed
silent: !process.env.DEBUG_INTEGRATION_TESTS,
// Allow parallel execution for independent tests
maxWorkers: 1, // Force serial execution to avoid circular reference issues
// Clear mocks between tests
clearMocks: true,
restoreMocks: true,
// Error handling
errorOnDeprecated: true,
// Display name for this configuration
displayName: {
name: 'Integration Tests',
color: 'blue',
},
// Optimized reporters
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: './test/integration/reports',
outputName: 'integration-test-results.xml',
suiteName: 'Autotask API Integration Tests',
},
],
],
// Performance optimizations
cache: true,
detectLeaks: false, // Disable for performance
forceExit: true, // Force exit after tests complete
};
module.exports = config;