forked from danny-avila/agents
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.mjs
More file actions
37 lines (33 loc) · 1.08 KB
/
jest.config.mjs
File metadata and controls
37 lines (33 loc) · 1.08 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
// jest.config.mjs
import { pathsToModuleNameMapper } from 'ts-jest';
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const tsconfig = require('./tsconfig.json');
const config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/src/**/*.test.ts', '**/src/**/*.spec.ts'],
moduleNameMapper: pathsToModuleNameMapper(tsconfig.compilerOptions.paths, {
prefix: '<rootDir>/'
}),
modulePaths: [
'<rootDir>'
],
verbose: true,
// setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testEnvironmentOptions: {
env: {
NODE_ENV: 'test'
}
},
// Limit concurrent test execution to avoid rate limits
maxWorkers: 7, // Number of worker processes
maxConcurrency: 1, // Number of tests that can run in each worker
// Alternative: use percentage of available CPUs
// maxWorkers: '50%',
// Optional: increase timeout for network requests
testTimeout: 30000, // 30 seconds (default is 5 seconds)
// Optional: run tests serially (one at a time) - uncomment if needed
// runInBand: true,
};
export default config;