-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.config.ts
More file actions
44 lines (37 loc) · 1.13 KB
/
vitest.config.ts
File metadata and controls
44 lines (37 loc) · 1.13 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
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
// Required for @fastify/autoload to work in tests
server: {
deps: {
inline: ['@fastify/autoload'],
},
},
// Coverage configuration
coverage: {
// Use v8 for faster coverage collection (native Node.js support)
provider: 'v8',
// Generate multiple report formats
reporter: ['text', 'json', 'html'],
// Output directory for coverage reports
reportsDirectory: './coverage',
// Include source files in coverage
include: ['src/**/*.ts'],
// Exclude non-application code from coverage
exclude: [
'src/index.ts', // Entry point - minimal testable logic
'src/config/healthcheck.ts', // Standalone script
'**/*.d.ts', // Type definitions
'**/*.test.ts', // Test files themselves
],
// Coverage thresholds - fail CI if below these values
// Start conservative and increase as coverage improves
thresholds: {
lines: 70,
functions: 70,
// branches: 60,
statements: 70,
},
},
},
})