-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
98 lines (97 loc) · 4.31 KB
/
Copy pathvitest.config.ts
File metadata and controls
98 lines (97 loc) · 4.31 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import type {} from "vitest/config";
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
define: {
__DEV_GIT_BRANCH__: JSON.stringify(""),
__DEV_PORT__: JSON.stringify(""),
__DEV_WORKTREE_NAME__: JSON.stringify(""),
},
resolve: {
tsconfigPaths: true,
},
test: {
pool: "threads",
environment: "happy-dom",
globals: true,
setupFiles: ["./src/test/setup.ts"],
include: ["src/**/*.{test,spec}.{ts,tsx}"],
exclude: ["node_modules", "src-tauri"],
coverage: {
provider: "v8",
reporter: ["text", "html", "json-summary", "json"],
reportsDirectory: "./coverage",
include: ["src/**/*.{ts,tsx}"],
exclude: [
"src/test/**",
"src/**/*.test.{ts,tsx}",
"src/**/*.spec.{ts,tsx}",
"src/components/ui/**",
"src/vite-env.d.ts",
"src/env.d.ts",
// src/types/ contains pure TypeScript type definitions with no runtime code
// and should not be counted toward coverage metrics
"src/types/**",
// main.tsx is the app entry point — cannot be meaningfully unit tested
"src/main.tsx",
// claude-data.ts is a deprecated 1-line re-export — testing the re-export
// itself is meaningless; the actual store (provider-data.ts) is tested.
"src/store/claude-data.ts",
// CodeMirror-dependent modules: require DOM APIs not available in JSDOM
"src/components/editor/CodeEditor.tsx",
"src/components/editor/gitGutter.ts",
// Zustand selector causes infinite re-renders in React strict mode tests
"src/components/session/SessionWidget.tsx",
// xterm.js requires real DOM APIs (WebGL, Canvas) not available in JSDOM
"src/components/terminal/TerminalWidget.tsx",
// usePty depends on xterm.js Terminal instance
"src/hooks/usePty.ts",
// NewSessionPopover uses Radix Popover which requires layout engine
// (PopoverContent doesn't render in JSDOM without real CSS layout)
"src/components/session/NewSessionPopover.tsx",
// SessionSidebar: 1200+ line mega-component with 10+ hooks, discovery
// polling, file watchers, drag-and-drop, and Radix Collapsible —
// requires integration testing, not unit testing in JSDOM
"src/components/session/SessionSidebar.tsx",
// Dialog-heavy components that require Radix Portal/overlay not
// available in JSDOM — need integration tests
"src/components/session/ResumeDialog.tsx",
"src/components/session/TakeOverConfirmDialog.tsx",
// Developer-only tools — not production code
"src/pages/developer-portal/**",
"src/pages/ShowcasePage.tsx",
"src/lib/react-devtools.ts",
"src/components/app/status-bar/items/DevToolsItem.tsx",
// Barrel re-export files — no runtime logic
"src/store/index.ts",
"src/store/connected-providers.ts",
"src/store/provider-accounts.ts",
"src/components/dashboard/index.ts",
"src/components/app/index.ts",
"src/components/session/index.ts",
"src/components/session/widgets/index.ts",
"src/components/settings/index.ts",
"src/components/chat/index.ts",
"src/hooks/index.ts",
"src/lib/index.ts",
// Mega-components with 10+ store hooks, DOM-heavy interactions
"src/components/session/ActivityBar.tsx",
"src/components/editor/MermaidBlock.tsx",
// DOM-heavy components requiring Popover/Dialog + Tauri IPC
"src/components/app/status-bar/items/MemoryActivityItem.tsx",
"src/components/settings/MemoryCallHistory.tsx",
"src/components/settings/PluginDetailDialog.tsx",
"src/components/settings/AccountSelectorCard.tsx",
// Massive settings component with 20+ hooks, OAuth flows
"src/components/settings/AccountDetailView.tsx",
// Large settings page with Dialog/AlertDialog/Tauri IPC
"src/pages/ProjectSettingsPage.tsx",
// Editor info status bar item — minimal testable logic
"src/components/app/status-bar/items/EditorInfoItem.tsx",
// Command registration — 10+ store/hook dependencies, tests verify keybindings not source
"src/commands/**",
],
},
},
});