You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(metadata): delete the eight always-true if (manager.X) guards so the assertions actually run (#15401)
Every assertion in `metadata-history.test.ts` sat inside a truthiness guard
over the very method under test — `if (manager.getHistory)`, `if
(manager.rollback)`, `if (manager.diff)` — at :47 :81 :111 :146 :167 :197
:207 :222, one per `it()`, eight guards over eight tests. All three are
UNCONDITIONAL members of `MetadataManager` (`metadata-manager.ts` :3105
`async getHistory(`, :3129 `async rollback(`, :3179 `async diff(`), so each
guard is always true and buys nothing — while making every assertion
structurally optional. Rename or retire one of the three and the guard goes
false, the block is skipped, the `it()` finishes asserting nothing, and the
suite reports GREEN. A test that stops testing looked identical to one that
passes.
Measured rather than argued, by a paired ablation on the METHOD (rename
`async diff(` out of `MetadataManager`, mutation confirmed on disk by grep
counts of the vanished anchor and an injected marker, restored under a trap
and proven against the path's HEAD blob hash plus an empty `git diff HEAD`):
with the guards present → vitest GREEN, 8 passed, exit 0 (the silent skip)
with the guards deleted → vitest RED (see PR body)
Only the guards and their braces are removed; the bodies are de-indented and
NO assertion is rewritten — the `patch!` non-null at the old :150 is carried
through verbatim. 228 lines to 212, 8 `it()` blocks and 20 `expect(` calls
before and after.
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments