-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.mts
More file actions
63 lines (55 loc) · 1.59 KB
/
vitest.config.mts
File metadata and controls
63 lines (55 loc) · 1.59 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
import { resolve } from 'path';
import { defineConfig } from 'vitest/config';
export default defineConfig({
resolve: {
alias: {
'@src': resolve(__dirname, './lib/src'),
},
},
test: {
coverage: {
// Provider - v8 is fast and works well for most cases
provider: 'v8',
// Reporters for different use cases
reporter: [
'text', // Console output during development
'text-summary', // Brief summary
'html', // Interactive HTML report for local viewing
'json-summary', // For badges and programmatic access
'lcov', // For CI/CD integrations (Codecov, Coveralls, etc.)
],
// What to include in coverage
include: ['lib/src/**/*.ts'],
// What to exclude from coverage
exclude: [
'lib/src/**/*.test.ts',
'lib/src/**/*.test-d.ts',
'lib/src/**/__tests__/**',
'lib/src/**/types.ts', // Type-only files
'lib/src/**/index.ts', // Re-export files typically don't need coverage
'lib/dist/**',
'examples/**',
'node_modules/**',
],
// Coverage thresholds - fail if coverage drops below these
thresholds: {
lines: 90,
functions: 90,
branches: 85,
statements: 90,
},
// Clean coverage directory before running tests
clean: true,
// Output directory
reportsDirectory: './coverage',
},
environment: 'node',
globals: true,
include: ['lib/**/*.test.ts'],
typecheck: {
ignoreSourceErrors: true,
include: ['**/*.test-d.ts'],
only: true,
},
},
});