-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathjest.config.js
More file actions
48 lines (42 loc) · 1.34 KB
/
Copy pathjest.config.js
File metadata and controls
48 lines (42 loc) · 1.34 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
module.exports = {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts'],
testMatch: ['**/tests/unit/**/*.test.ts', '**/tests/unit/**/*.spec.ts'],
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/tests/integration/', '/tests/fixtures/'],
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts', '!src/**/index.ts', '!src/bin/**/*'],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'text-summary', 'html', 'lcov'],
coverageThreshold: {
global: { branches: 20, functions: 25, lines: 30, statements: 30 },
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@tests/(.*)$': '<rootDir>/tests/$1',
},
// Transform ES modules from node_modules that Jest can't handle
transformIgnorePatterns: [
'node_modules/(?!(@agentclientprotocol|zod|uuid)/)',
],
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
// globalTeardown: '<rootDir>/tests/teardown.js', // Disabled for unit tests
transform: {
'^.+\\.tsx?$': ['ts-jest', {
tsconfig: 'tsconfig.json',
useESM: true,
}],
'^.+\\.m?js$': ['ts-jest', {
tsconfig: {
module: 'commonjs',
},
}],
},
testTimeout: 10000,
maxWorkers: 1,
clearMocks: true,
restoreMocks: true,
errorOnDeprecated: true,
detectOpenHandles: true,
forceExit: true,
verbose: true,
};