-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.performance.config.js
More file actions
50 lines (40 loc) · 1.54 KB
/
jest.performance.config.js
File metadata and controls
50 lines (40 loc) · 1.54 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
/**
* Jest configuration for performance budget tests.
*
* Intentionally does NOT use the global fs-extra mock or the mocked
* ConfigManager — performance tests must exercise the real filesystem so that
* timings are meaningful.
*
* Run with:
* npm run test:performance
*/
export default {
testEnvironment: 'node',
// Only match files inside tests/performance/
testMatch: ['**/tests/performance/**/*.test.js'],
// Transform ESM files with Babel (same as main config)
transform: {
'^.+\\.(js|jsx)$': 'babel-jest',
},
// Allow all node_modules to be transformed so ESM packages work
transformIgnorePatterns: [],
// Map @/ shorthand used in some src imports
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1.js',
// Keep lightweight UI mocks — these are never used by performance tests
// but prevent import errors if transitive deps pull them in.
'^chalk$': '<rootDir>/tests/mocks/chalk.js',
'^ora$': '<rootDir>/tests/mocks/ora.js',
'^.*/utils/logger\\.js$': '<rootDir>/tests/mocks/logger.js',
'^.*/config\\.js$': '<rootDir>/tests/mocks/config.js',
},
// Minimal setup — only env variables, no global mock overrides
setupFiles: ['<rootDir>/tests/setup-env.js'],
// Performance tests can take a long time (fixture generation + discovery)
testTimeout: 120_000, // 2 minutes per test
// Run tests sequentially so memory measurements are not skewed by concurrency
maxWorkers: 1,
// Clear mocks between tests (no-op here since we have no global mocks)
clearMocks: true,
verbose: true,
};