import { defineConfig } from 'vitest/config' export default defineConfig({ test: { globals: true, environment: 'node', include: ['test/**/*.test.ts'], coverage: { provider: 'v8', reporter: ['text', 'json', 'html'], include: ['src/**/*.ts'], exclude: [ 'src/**/*.d.ts', 'src/**/*.test.ts', // CLI entry — integration-tested via e2e 'src/index.ts', // TUI entry point — integration-tested via e2e 'src/repl/ink-repl.ts', // TTY-only interactive pickers — require a real TTY for input/output 'src/repl/ask-user.ts', 'src/repl/permission-picker.ts', 'src/repl/model-picker.ts', 'src/repl/session-picker.ts', 'src/repl/mcp-picker.ts', 'src/repl/onboarding.ts', 'src/repl/oneshot.ts', 'src/repl/spinner.ts', 'src/repl/screen.ts', // God-class REPL (P3 refactor pending) — TTY + agentic loop mixed, // 2100+ lines; core logic extracted to dedicated modules with own tests 'src/repl/repl.ts', // Terminal renderer — depends on live subscription state and TTY dimensions 'src/repl/renderer.ts', // Tool executor — requires full agent + permission + MCP stack to mock 'src/tools/executor.ts', // background.ts — spawns real child processes; covered by e2e suite 'src/tools/background.ts', // notebook.ts — manipulates real .ipynb files; needs fixture infra 'src/tools/notebook.ts', // Provider adapters — tested with real fetch/WS in integration suite 'src/api/anthropic.ts', 'src/api/google.ts', 'src/api/openai.ts', // Auth classes — require OAuth browser flow or disk creds; tested in integration 'src/auth/anthropic.ts', 'src/auth/google.ts', 'src/auth/openai.ts', 'src/auth/manager.ts', // State singleton (init-only, tested indirectly) 'src/state/state.ts', ], thresholds: { // Thresholds apply to business-logic modules only (TTY/integration files excluded above). // Current actual coverage: lines ~50%, functions ~55%, branches ~44%, statements ~50%. // Target: raise 5pp per release cycle as integration test suite expands. lines: 46, functions: 52, branches: 40, statements: 46, }, }, }, })