-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvitest.config.ts
More file actions
54 lines (51 loc) · 1.77 KB
/
vitest.config.ts
File metadata and controls
54 lines (51 loc) · 1.77 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
import { defineConfig, configDefaults } from 'vitest/config'
import { resolve } from 'path'
export default defineConfig({
test: {
environment: 'jsdom',
globals: true,
exclude: [
...configDefaults.exclude,
'tests/e2e/**', // Playwright specs (run via `npm run test:e2e`)
],
setupFiles: ['./tests/setup.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'dist/',
'tests/',
'**/*.d.ts',
'**/*.config.*',
'**/coverage/**',
// Exclude legacy/dead code to stop diluting coverage metrics
'archive/**',
'chrome_extension/**',
'**/*.legacy.*',
'workers/**', // Workers need separate test strategy
],
// Per-file thresholds: prevent regression in well-tested modules
// while allowing gradual improvement in others
thresholds: {
// High-quality modules (prevent regression)
'services/aiService.ts': { lines: 40, functions: 40 },
'components/diff/**': { lines: 95, functions: 95 },
// Critical path (raise gradually)
'components/ChapterView.tsx': { lines: 30, functions: 15 },
'adapters/providers/OpenAIAdapter.ts': { lines: 50, functions: 40 },
'adapters/providers/GeminiAdapter.ts': { lines: 50, functions: 40 },
'adapters/providers/ClaudeAdapter.ts': { lines: 50, functions: 40 },
// Services with good tests (maintain)
'services/diff/DiffAnalysisService.ts': { lines: 70, functions: 60 },
'services/HtmlSanitizer.ts': { lines: 80, functions: 80 },
'services/HtmlRepairService.ts': { lines: 75, functions: 75 },
}
}
},
resolve: {
alias: {
'@': resolve(__dirname, '.')
}
}
})