-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjest.config.e2e.js
More file actions
45 lines (42 loc) · 1.17 KB
/
Copy pathjest.config.e2e.js
File metadata and controls
45 lines (42 loc) · 1.17 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
// jest.config.e2e.js
/* eslint-env node */
/* global module */
const baseConfig = require('./jest.config.js');
/**
* @description Jest configuration for end-to-end tests only.
* @type {import('@jest/types').Config.InitialOptions}
*/
// Relax coverage gates automatically for single-file/targeted runs
const isTargetedRun = process.argv.some(
(arg) =>
arg.includes('tests/e2e/') ||
arg.endsWith('.test.js') ||
arg.endsWith('.spec.js')
);
module.exports = {
...baseConfig,
displayName: 'e2e',
testMatch: [
'<rootDir>/tests/e2e/**/*.test.js',
'<rootDir>/tests/e2e/**/*.spec.js',
'<rootDir>/tests/e2e/**/*.e2e.test.js',
],
// E2E tests may take even longer
testTimeout: 60000,
maxWorkers: 6, // Limit concurrent workers
// Enable force exit to prevent hanging
forceExit: true,
// Increase memory limits for E2E tests
workerIdleMemoryLimit: '512MB',
// E2E tests have lower coverage expectations due to their nature; skip gates for targeted runs
coverageThreshold: isTargetedRun
? undefined
: {
global: {
branches: 20,
functions: 25,
lines: 25,
statements: 25,
},
},
};