test(bun-integration-tests): Type-check test suites in CI#22059
Merged
Conversation
JPeer264
approved these changes
Jul 8, 2026
mydea
added a commit
that referenced
this pull request
Jul 8, 2026
) The `suites/**` files in `cloudflare-integration-tests` were never type-checked in CI: there was no `type-check` script, and vitest transpiles with esbuild (no type-checking). The suites are already covered by `tsconfig.json`, so this adds a gate and fixes the ~30 latent type errors it surfaced. **All fixes are type-only — no runtime behavior changed.** ## Changes - Add a `type-check` script (`tsc --noEmit`) and run `yarn type-check` for the package in the **Lint** CI job. - **Worker fixtures** (`suites/tracing/propagation/**`): drop an incorrect `implements RpcTarget` (Durable Objects expose their public methods over RPC inherently), and let the `WorkerEntrypoint` classes use the ambient `Cloudflare.Env` — which is what `withSentry`'s `WorkerEntrypointConstructor` requires — casting `this.env` to the local `Env` for binding access. (A global `Cloudflare.Env` augmentation would be more idiomatic but collides across fixtures that declare the same binding name with different DO classes into one tsc program.) - **AI assertions** (`google-genai` / `langchain` / `langgraph` test files): type the `span` callback params as `SerializedStreamedSpan`. - Narrow envelope items before accessing `.spans` in the durable-object tests, and fix the runner's `Expected` argument typing. - Targeted, commented casts for version-skewed AI mocks (LangChain callback handler, OpenAI mock client, vercel AI mock language model). - Exclude `suites/prisma/**` from the check — it imports a Prisma-generated client (`./generated`) that only exists after codegen. Part of a small series adding suite type-checking to the integration-test packages (alongside `node-integration-tests` and `bun-integration-tests` #22059). `deno-integration-tests` is intentionally skipped — it's a Deno project (`deno test --no-check`) that `tsc` can't type-check (URL imports, `Deno` globals). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The `suites/**` test files were never type-checked in CI: there was no `type-check` script and vitest transpiles with esbuild (no type-checking). The suites are already covered by `tsconfig.json`, so this just adds a gate. - Add a `type-check` script (`tsc --noEmit`). - Run `yarn type-check` for the package in the Lint CI job. The suites are already type-clean, so no source changes were needed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
d8f9cca to
04e4ee6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 04e4ee6. Configure here.
| "lint": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --type-aware", | ||
| "lint:fix": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --fix --type-aware", | ||
| "type-check": "tsc", | ||
| "lint:types": "tsc --noEmit", |
There was a problem hiding this comment.
Pretest calls removed script
Medium Severity
The pretest script still runs yarn type-check, but that npm script was renamed to lint:types in the same change. Any yarn test in this package fails during the lifecycle hook before tests run.
Reviewed by Cursor Bugbot for commit 04e4ee6. Configure here.
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.


The
suites/**test files were never type-checked in CI: there was notype-checkscript, and vitest transpiles with esbuild (no type-checking). The suites are already covered bytsconfig.json, so this just adds the gate.type-checkscript (tsc --noEmit).yarn type-checkfor the package in the Lint CI job.The suites are already type-clean, so no source changes were needed.
Part of a small series adding suite type-checking to the integration-test packages (alongside
node-integration-tests).