Fix pre-existing typecheck failures in register tests (CLI-FND-002) - #39
Open
cryptoxdog wants to merge 1 commit into
Open
Fix pre-existing typecheck failures in register tests (CLI-FND-002)#39cryptoxdog wants to merge 1 commit into
cryptoxdog wants to merge 1 commit into
Conversation
The `typecheck` gate (tsconfig.check.json, which includes tests/) failed with 3 TS2493 errors: `valuesMock.mock.calls[0][0]` indexed the first insert arg, but valuesMock was `vi.fn(() => …)` with a zero-arg implementation, so its call args were inferred as the empty tuple `[]` — index 0 is a compile error. Declare the argument the mock actually receives (`(_values: Record<string, unknown>) => …`) so `mock.calls[0]` is a non-empty tuple. No runtime/behavior change; the register suites still pass (13 tests). This clears the last 3 errors so `npm run typecheck` exits 0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SjcHn8jZErKo37ZJi6qybX
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Stacked PR — quality fix on top of #38
Stacked on #38 (Phase 3). Base is
claude/new-session-br7qjb-phase-3; this PR's diff shows only the register-test fix. Retarget tomainonce the stack lands.Problem
npm run typecheck(the assurancetypecheckgate usestsconfig.check.json, which includestests/) fails with 3 pre-existingTS2493errors — present at base0a660de, unrelated to any prior PR in this stack:Each is a
valuesMock.mock.calls[0][0]read (the firstinsert().values(...)argument).valuesMockwas defined asvi.fn(() => ({ … }))— a zero-argument implementation — so vitest infers its call-args as the empty tuple[], and indexing[0]on a length-0 tuple is a compile error.Fix
Declare the argument the mock actually receives:
Now
mock.calls[0]is a non-empty tuple and[0]typechecks. No runtime or behavior change — the impl still returns the same chain object; the register suites pass unchanged (13 tests).Evidence
npm run typecheck→ exit 0, 0 errors (was 3).NODE_ENV=test vitest run→ 149/149.This is the fix for finding CLI-FND-002 recorded in the unthrottle pack.
Generated by Claude Code