-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathjest.e2e.tools.config.js
More file actions
63 lines (53 loc) · 1.45 KB
/
jest.e2e.tools.config.js
File metadata and controls
63 lines (53 loc) · 1.45 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
// @ts-check
/** @type {import('jest').Config} */
const config = {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
testMatch: [
'**/src/__tests__/e2e/tools/**/*.e2e.ts'
],
setupFilesAfterEnv: ['<rootDir>/src/__tests__/e2e/setup.ts'],
transformIgnorePatterns: [
'node_modules/(?!(@octokit|@modelcontextprotocol)/)',
],
transform: {
'^.+\\.tsx?$': ['ts-jest', {
useESM: true,
tsconfig: 'tsconfig.json'
}]
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
extensionsToTreatAsEsm: ['.ts'],
testTimeout: 60000, // 60 seconds for comprehensive E2E tests
verbose: true,
maxConcurrency: 1, // Run tests sequentially to avoid conflicts
bail: false, // Continue running tests even if some fail
collectCoverage: false, // Disable coverage for E2E tests
// Environment variables for testing
setupFiles: ['<rootDir>/jest.e2e.tools.setup.mjs'],
// Test reporting
reporters: ['default'],
// Global test configuration
globals: {
'ts-jest': {
useESM: true
}
},
// Test environment options
testEnvironmentOptions: {
url: 'http://localhost'
},
// Clear mocks between tests
clearMocks: true,
resetMocks: false,
restoreMocks: false,
// Force exit after tests complete
forceExit: true,
// Detect open handles
detectOpenHandles: true,
// Test name pattern for filtering
testNamePattern: process.env.TEST_NAME_PATTERN
};
export default config;