fix(cloud): type the enqueueRunWorkflow mock so cancel.test.ts typechecks - #398
Merged
Conversation
…ecks Landed in #397 without re-running `pnpm typecheck` after adding the test file — `pnpm build` and `pnpm test` both passed locally, which is a different (looser) check than `tsc --noEmit` over test files, so this merged to master broken and the cloud CI build check caught it after merge instead of before. vi.fn(async () => undefined) has no declared parameters, so TS infers the mock's call-args tuple as `[]` — indexing `.mock.calls[0]![1]` to read the `delayMs` option then fails to typecheck. Give the mock two declared (ignored) parameters so the inferred tuple actually has an index 1. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Master is currently broken:
pnpm typecheckfails oncancel.test.ts, merged in #397.pnpm buildandpnpm testboth passed before that merge, which made it look clean —tsc --noEmitover test files is a different, stricter check that neither of those runs.vi.fn(async () => undefined)has no declared parameters, so TypeScript infers the mock's.mock.callsentries as the empty tuple[]. Indexing.mock.calls[0]![1]to inspect thedelayMsoption then fails:Tuple type '[]' of length '0' has no element at index '1'.Fix: give the mock two declared (intentionally unused) parameters matching
enqueueRunWorkflow's real shape, so the inferred call-args tuple actually has an index 1.Test plan
pnpm typecheck— clean (was failing on this exact file before).pnpm testagainst a clean isolated Postgres/Redis — 243/243 pass.pnpm build— clean.This time I ran the full validation set — including
typecheck, which is what I missed in #397 — before opening this PR.🤖 Generated with Claude Code