Skip to content

fix(cloud): type the enqueueRunWorkflow mock so cancel.test.ts typechecks - #398

Merged
mohabbis merged 1 commit into
masterfrom
fix/cancel-test-typecheck
Aug 4, 2026
Merged

fix(cloud): type the enqueueRunWorkflow mock so cancel.test.ts typechecks#398
mohabbis merged 1 commit into
masterfrom
fix/cancel-test-typecheck

Conversation

@mohabbis

@mohabbis mohabbis commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

Master is currently broken: pnpm typecheck fails on cancel.test.ts, merged in #397. pnpm build and pnpm test both passed before that merge, which made it look clean — tsc --noEmit over 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.calls entries as the empty tuple []. Indexing .mock.calls[0]![1] to inspect the delayMs option 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 test against 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

…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>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ghost Ready Ready Preview Aug 4, 2026 1:26am

@mohabbis
mohabbis merged commit f0c215b into master Aug 4, 2026
8 checks passed
@mohabbis
mohabbis deleted the fix/cancel-test-typecheck branch August 4, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant