Repository navigation
Commit e48a66e
committed
test(activate): restore the diagnostics wiring case 375e255 dropped
The 375e255 merge of upstream/main took this branch copy of src/activate/__tests__/registerCommands.spec.ts over mains and dropped ten upstream titles. The one that came back with nothing behind it was creates diagnostics from all provider instances without requiring a visible provider: the head tree tested createDiagnosticsReport itself in src/services/diagnostics/__tests__/command.spec.ts, always with providers: [], and never asserted what the command handler passes to it. This commit restores that case. The handler hands every live instance to the report builder and never consults the visible provider (registerCommands.ts:249-254), so the case pins the wiring: two instances, no visible instance, and a payload of context, outputChannel and exactly those providers.
Control run: changing the handler to read providers: ClineProvider.getVisibleInstance() ? ClineProvider.getAllInstances() : [] makes the case fail on the payload (providers [] against the two instances); with the handler as written it passes. Baseline whole registerCommands.spec.ts on d19bb3f was 60 passed, after the change 61 passed, target 1 passed. tsc -p tsconfig.json clean, eslint --max-warnings=0 --no-warn-ignored clean on the file with src/eslint-suppressions.json untouched, prettier --check clean.
The other title 375e255 dropped from this file group, postMessageToWebview does not throw when webview is disposed, is deliberately not rewritten here: src/core/webview/__tests__/ClineProvider.spec.ts:3317 already contains that exact body - the same disposal mock, the same message, the same await expect(provider.postMessageToWebview(message)).resolves.toBeUndefined() at line 3327 - plus a stronger assertion on the dropped-message log, and spec:8608 covers the disposed-view early return. Duplicating it would have added a copy without adding a pin.
Hook note: this commit ran the husky pre-commit hook for real - no --no-verify. The hook execs lint-staged through npx and lint-staged runs pnpm --dir src exec eslint, so the PATH used for the commit was extended with the npm global bin directory that carries pnpm (pnpm --version resolves to the pinned 10.8.1 there); without it this lane has no pnpm and the hook would have been skipped rather than run.1 parent d19bb3f commit e48a66e
1 file changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
| |||
198 | 202 | | |
199 | 203 | | |
200 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
201 | 224 | | |
202 | 225 | | |
203 | 226 | | |
| |||
0 commit comments