-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
42 lines (38 loc) · 1.05 KB
/
jest.config.js
File metadata and controls
42 lines (38 loc) · 1.05 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
/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src', '<rootDir>/tests'],
testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],
// Coverage
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
],
coveragePathIgnorePatterns: [
'<rootDir>/src/index.ts',
'<rootDir>/src/http/server.ts',
'<rootDir>/src/http/routes.ts',
'<rootDir>/src/http/wellKnown.ts',
'<rootDir>/src/metrics/index.ts',
'<rootDir>/src/logging/index.ts',
'<rootDir>/src/mcp/adapter.ts'
],
// (Optional) If you later want to gate coverage, uncomment and tune:
// coverageThreshold: {
// global: { statements: 60, branches: 55, functions: 60, lines: 60 },
// },
// Stability & DX
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
testTimeout: 10000,
detectOpenHandles: true,
clearMocks: true,
restoreMocks: true,
// ts-jest tuning for perf & TS 5.x
globals: {
'ts-jest': {
isolatedModules: true,
diagnostics: true,
},
},
};