-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvitest.config.js
More file actions
43 lines (42 loc) · 1.6 KB
/
Copy pathvitest.config.js
File metadata and controls
43 lines (42 loc) · 1.6 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
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'node',
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov'],
include: ['bin/cli-functions.js'],
exclude: [
'bin/cli.js', // Exclude the CLI wrapper - tested via integration tests
'node_modules/**',
'tests/**',
'scripts/**',
'verdaccio/**',
'**/*.config.js',
],
// Coverage thresholds for workspace-architect CLI
// Note: CLI tools have unique testing challenges:
// - Heavy I/O operations (file system, network, user prompts)
// - External process execution in integration tests doesn't count toward coverage
// - Many code paths require specific runtime environments
//
// Our approach combines:
// - Unit tests for pure logic functions (normalizeCollectionItems, convertYamlItemsToFlat)
// - Integration tests for CLI commands (list, download with all flags)
//
// Thresholds reflect testable code (helper functions, validation, parsing)
// while accepting that I/O-heavy paths are validated through integration tests
//
// After review feedback: Increased from initial 10-13% to be more stringent
// Current achievable coverage with integration testing approach: ~13% lines, 20% functions
// Thresholds set slightly below to allow for minor fluctuations while enforcing quality
thresholds: {
lines: 12,
functions: 20,
branches: 10,
statements: 13,
},
},
},
});