Skip to content

test(bun-integration-tests): Type-check test suites in CI#22059

Merged
mydea merged 3 commits into
developfrom
feat/bun-integration-tests-type-check
Jul 8, 2026
Merged

test(bun-integration-tests): Type-check test suites in CI#22059
mydea merged 3 commits into
developfrom
feat/bun-integration-tests-type-check

Conversation

@mydea

@mydea mydea commented Jul 8, 2026

Copy link
Copy Markdown
Member

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 the 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.

Part of a small series adding suite type-checking to the integration-test packages (alongside node-integration-tests).

@mydea mydea requested a review from a team as a code owner July 8, 2026 09:17
@mydea mydea requested review from JPeer264, andreiborza and isaacs and removed request for a team July 8, 2026 09:17
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>
mydea and others added 3 commits July 8, 2026 12:26
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>
@mydea mydea force-pushed the feat/bun-integration-tests-type-check branch from d8f9cca to 04e4ee6 Compare July 8, 2026 10:29
@mydea mydea requested a review from a team as a code owner July 8, 2026 10:29
@mydea mydea requested review from Lms24 and logaretm and removed request for a team July 8, 2026 10:29
@mydea mydea enabled auto-merge (squash) July 8, 2026 10:29

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 04e4ee6. Configure here.

@mydea mydea merged commit 0504d25 into develop Jul 8, 2026
302 checks passed
@mydea mydea deleted the feat/bun-integration-tests-type-check branch July 8, 2026 10:49
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.

2 participants