chore(test): migrate to vitest 4 + pool-workers 0.18#34
Open
grrowl wants to merge 1 commit into
Open
Conversation
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>
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.
Mechanical bump of the test toolchain to vitest 4. No test-assertion edits, no
src/changes, dev-tooling only.What changed
vitest3.2.4→4.1.10@cloudflare/vitest-pool-workers0.12.21→0.18.7(bundles wrangler 4.113.0, miniflare 4.20260721.0, workerd 1.20260721.1)package-lock.jsonregeneratedvitest.config.tsandtests/env.d.tsmigrated (below)Why it's mechanical
Only two source-of-breakage items, both covered by the official
vitest-v3-to-v4codemod shipped in@cloudflare/vitest-pool-workers/dist/codemods/:vitest.config.ts—defineWorkersProjectis removed. Config is nowdefineConfig({ plugins: [cloudflareTest({ ... })], test: {} }), with the oldpoolOptions.workerscontents moved verbatim intocloudflareTest. Compat date (2026-03-10) and all DO bindings unchanged.tests/env.d.ts—cloudflare:testtypes moved to the@cloudflare/vitest-pool-workers/typesexport; theProvidedEnvinterface is replaced bydeclare 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: successnpm test: 47 test files / 225 tests, all passing, none skippednpm run typecheck: cleanPart of #29 (the eviction test itself is separate; this PR only moves the runner).
🤖 Generated with Claude Code