Skip to content

chore(test): migrate to vitest 4 + pool-workers 0.18#34

Open
grrowl wants to merge 1 commit into
mainfrom
chore/vitest-4
Open

chore(test): migrate to vitest 4 + pool-workers 0.18#34
grrowl wants to merge 1 commit into
mainfrom
chore/vitest-4

Conversation

@grrowl

@grrowl grrowl commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Mechanical bump of the test toolchain to vitest 4. No test-assertion edits, no src/ changes, dev-tooling only.

What changed

  • vitest 3.2.44.1.10
  • @cloudflare/vitest-pool-workers 0.12.210.18.7 (bundles wrangler 4.113.0, miniflare 4.20260721.0, workerd 1.20260721.1)
  • package-lock.json regenerated
  • vitest.config.ts and tests/env.d.ts migrated (below)

Why it's mechanical

Only two source-of-breakage items, both covered by the official vitest-v3-to-v4 codemod shipped in @cloudflare/vitest-pool-workers/dist/codemods/:

  1. vitest.config.tsdefineWorkersProject is removed. Config is now defineConfig({ plugins: [cloudflareTest({ ... })], test: {} }), with the old poolOptions.workers contents moved verbatim into cloudflareTest. Compat date (2026-03-10) and all DO bindings unchanged.
  2. tests/env.d.tscloudflare:test types moved to the @cloudflare/vitest-pool-workers/types export; the ProvidedEnv interface is replaced by declare namespace Cloudflare { interface Env { ... } }.

Wrangler alignment (skipped, deliberately)

Root wrangler@^4 (currently 4.95.0) coexists fine with the pool's bundled 4.113.0. Bumping root wrangler to ≥4.113 to dedupe the workerd binaries was considered and skipped to keep this PR surgical — it's a separate, non-blocking cleanup.

Results

  • npm install: success
  • npm test: 47 test files / 225 tests, all passing, none skipped
  • npm run typecheck: clean

Part of #29 (the eviction test itself is separate; this PR only moves the runner).

🤖 Generated with Claude Code

Mechanical bump of the test runner. Two source-of-breakage items, both
covered by the official vitest-v3-to-v4 codemod:

- vitest.config.ts: `defineWorkersProject` is removed; config is now
  `defineConfig({ plugins: [cloudflareTest({ ... })], test: {} })` with the
  old `poolOptions.workers` contents moved verbatim into `cloudflareTest`.
- tests/env.d.ts: `cloudflare:test` types moved to the
  `@cloudflare/vitest-pool-workers/types` export; the `ProvidedEnv`
  interface is replaced by `declare namespace Cloudflare { interface Env }`.

No behaviour change: 47 test files / 225 tests all green, typecheck clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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