-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
57 lines (57 loc) · 2.1 KB
/
jest.config.js
File metadata and controls
57 lines (57 loc) · 2.1 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
51
52
53
54
55
56
57
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
roots: ['<rootDir>/tests'],
testMatch: ['**/*.test.ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
tsconfig: 'tsconfig.json',
},
],
},
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'^@/(.*)$': '<rootDir>/src/$1',
},
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
testTimeout: 30000,
verbose: true,
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/**/index.ts',
// Exclude auto-generated API control files (thin wrappers, auto-generated)
'!src/**/api/control.ts',
// Exclude server module (requires HTTP server testing infrastructure)
'!src/server/**',
// Exclude integration modules (external service dependencies)
'!src/integration/**',
// Exclude low-level HTTP client (requires complex network mocking)
'!src/utils/data-api.ts',
// Exclude sandbox data API layer (requires network mocking, similar to data-api.ts)
'!src/sandbox/api/*.ts',
// Exclude sandbox subclasses that heavily depend on Data API (aio, browser, code-interpreter)
'!src/sandbox/aio-sandbox.ts',
'!src/sandbox/browser-sandbox.ts',
'!src/sandbox/code-interpreter-sandbox.ts',
// Exclude sandbox.ts and client.ts (complex API response handling and templateType branching logic)
'!src/sandbox/sandbox.ts',
'!src/sandbox/client.ts',
// Exclude MCP adapter (requires external MCP server)
'!src/toolset/api/mcp.ts',
// Exclude OpenAPI parser (complex HTTP/schema mocking, partially covered)
'!src/toolset/openapi.ts',
// Exclude toolset.ts (complex external SDK client creation and OpenAPI/MCP invocation, 86% covered)
'!src/toolset/toolset.ts',
// Exclude logging utilities (complex stack frame parsing, 72% covered)
'!src/utils/log.ts',
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'json'],
};