-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
44 lines (43 loc) · 1.65 KB
/
Copy pathvitest.config.ts
File metadata and controls
44 lines (43 loc) · 1.65 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: {
environment: 'node',
include: ['tests/**/*.test.ts'],
globalSetup: ['./tests/globalSetup.ts'],
coverage: {
provider: 'v8',
include: ['src/**/*.ts'],
exclude: [
'src/index.ts',
// I/O adapters — require live infrastructure; dispatcher.ts and format.ts are unit-testable and NOT excluded
'src/sinks/file.ts',
'src/sinks/homeassistant.ts',
'src/sinks/openclaw.ts',
'src/sinks/stdout.ts',
'src/sinks/telegram.ts',
'src/sinks/webhook.ts',
'src/commands/install.ts', // system-level operations — require OS privilege
'src/commands/uninstall.ts', // system-level operations — require OS privilege
// Live infrastructure required: cannot be unit-tested
'src/mcp/device-history.ts', // MCP streaming protocol (live server required)
'src/mcp/events-subscription.ts', // MCP event subscription (live server required)
'src/mqtt/client.ts', // MQTT broker required
'src/llm/providers/anthropic.ts', // Anthropic API key + live endpoint required
'src/llm/providers/openai.ts', // OpenAI API key + live endpoint required
],
reporter: ['text', 'html'],
// Thresholds locked to post-2026-05-17 backfill actuals.
// Hard ceiling: see docs/coverage-annotations.md for excluded + structurally untestable files.
thresholds: {
lines: 81,
branches: 79,
'src/commands/**': {
lines: 75,
branches: 74,
},
},
},
clearMocks: true,
restoreMocks: true,
},
});