Commit 8b8edc7
test: consolidate test mocks into reusable factories
- Create comprehensive mock factories in test-helpers.ts
- Storage variants (with auth, minimal)
- Workspace variants (running, stopped, failed, with build)
- VSCode components (RemoteSSH, TreeView, StatusBar, QuickPick, Terminal, OutputChannel)
- Provider factories (WorkspaceProvider, TreeDataProvider)
- Other utilities (Remote, Commands, EventEmitter, Axios, ProxyAgent, Uri)
- Migrate all test files to use mock factories
- api.test.ts: Replace inline process/WebSocket mocks, use createMockApi
- commands.test.ts: Replace all inline mocks with factories
- extension.test.ts: Consolidate context, provider, and remote mocks
- workspaceMonitor.test.ts: Use getPrivateProperty helper, eliminate inline mocks
- workspacesProvider.test.ts: Replace vscode module mock with factory
- inbox.test.ts: Remove type casting patterns
- headers.test.ts: Use createMockConfiguration
- remote.test.ts: Update Storage mock to use factory
- Improve test quality and maintainability
- Reduce 'as any' casts from 95 to 4 (96% reduction)
- Eliminate all inline mock object definitions
- Remove unsafe type casting patterns
- Centralize mock creation logic
- All 405 tests passing with 78.49% coverage
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 8505c4f commit 8b8edc7
File tree
11 files changed
+1605
-1105
lines changed- src
11 files changed
+1605
-1105
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
0 commit comments