-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
67 lines (66 loc) · 3.44 KB
/
Copy pathvitest.config.ts
File metadata and controls
67 lines (66 loc) · 3.44 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
58
59
60
61
62
63
64
65
66
67
import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vitest/config';
export default defineConfig({
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'virtual:pwa-register': fileURLToPath(new URL('./tests/mocks/pwaRegister.ts', import.meta.url)),
},
},
test: {
environment: 'jsdom',
setupFiles: ['./tests/setup.ts'],
testTimeout: 10_000,
include: ['tests/{unit,component}/**/*.{test,spec}.{ts,tsx}', 'src/plugins/**/*.test.{ts,tsx}', 'src/host/**/*.test.{ts,tsx}'],
clearMocks: true,
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'json-summary'],
include: [
'src/shared/lib/storage.ts',
'src/shared/lib/containerPaths.ts',
'src/shared/lib/tokenEstimate.ts',
'src/shared/lib/boundedBuffer.ts',
'src/shared/api/{llm,models,llmError}.ts',
'src/shared/config/{providers,personas,personaPrompts}.ts',
'src/plugins/settings/providerPresets.ts',
'src/entities/workspace/{repository,store,sessionStore,containerStore,deletionCoordinator}.ts',
'src/entities/persistence/{v3*,persistenceSanitizer}.ts',
'src/plugins/ui-chat/lib/extractChatContent.ts',
'src/plugins/files/fileUtils.ts',
'src/plugins/**/*.ts',
'src/host/**/*.ts',
],
exclude: ['**/*.d.ts', '**/*.tsx', '**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts', '**/*.spec.tsx', '**/manifest.generated.ts', 'src/plugins/agent/useAgentV2.ts'],
// P1-06:聚合阈值之上,对低于全局标准的文件单独设下限(阻止「聚合达标掩盖单文件滑坡」)。
// P2-06:runtime/succinix 插件化后分支覆盖 79.1%(新增适配器/registry 分支),
// 全局 branches 阈值按 G-17 随迁移阶段调整为 79;后续 P 删除胶水后再收敛。
// 不启用 perFile——vitest 的 perFile 会把全局阈值逐文件强制应用,glob 覆盖无法豁免;
// 每个 glob 匹配单个文件即等价 per-file 下限,补测后可上调。
thresholds: {
lines: 85,
functions: 85,
branches: 79,
statements: 85,
'**/pi/piToolAdapter.ts': { lines: 62, functions: 44, branches: 80, statements: 66 },
'**/shared/lib/storage.ts': { lines: 71, statements: 66 },
'**/pi/piStreamHelpers.ts': { lines: 77, functions: 69, branches: 58, statements: 68 },
'**/eventStore.ts': { lines: 82, functions: 80, branches: 62, statements: 83 },
'**/pi/piCompaction.ts': { lines: 83, functions: 80, branches: 66, statements: 80 },
'**/useAgentV2Selectors.ts': { lines: 82, branches: 79, statements: 82 },
'**/driver/codexDriver.ts': { functions: 60 },
'**/driver/claudeCodeDriver.ts': { lines: 67, branches: 53, statements: 59 },
'**/containerStore.ts': { branches: 70 },
'**/serviceRegistry.ts': { functions: 76, branches: 73, statements: 76 },
'**/resourceProcessor.ts': { branches: 75 },
'**/persistenceSanitizer.ts': { functions: 81 },
'**/WebContainerAgentRuntime.ts': { functions: 67, branches: 78, statements: 82 },
'**/succinixProcessShims.ts': { functions: 67, branches: 64, statements: 82 },
'**/shared/api/llm.ts': { branches: 73, statements: 81 },
'**/config/providers.ts': { branches: 71 },
'**/tools/resourceTools.ts': { branches: 75 },
'**/workspace/store.ts': { functions: 72 },
},
},
},
});