Skip to content

[Workers] Add Vitest 3 to Vitest 4 migration guide for vitest-pool-workers - #31648

Merged
MattieTK merged 3 commits into
productionfrom
vitest-pool-workers-migrate-to-vitest-4
Jun 25, 2026
Merged

[Workers] Add Vitest 3 to Vitest 4 migration guide for vitest-pool-workers#31648
MattieTK merged 3 commits into
productionfrom
vitest-pool-workers-migrate-to-vitest-4

Conversation

@MattieTK

@MattieTK MattieTK commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

Adds a new how-to page, Migrate from Vitest 3 to Vitest 4, under the Workers Vitest integration migration guides. It documents migrating @cloudflare/vitest-pool-workers from v0.12.x (Vitest 3) to v0.13.x (Vitest 4): the cloudflareTest() plugin config API, the jscodeshift codemod, the isolatedStorage/singleWorker removal, the deprecated cloudflare:test imports (env/SELF moving to cloudflare:workers), and the fetchMock removal.

The source material is the v0.13.0 release notes (cloudflare/workers-sdk#11632), as suggested during review of #29465. This supersedes that closed PR and addresses #29463.

Content was validated line by line against the published package (npm @cloudflare/vitest-pool-workers 0.13.0 and the current 0.16.18): the shipped type definitions, the codemod source, and the source PR body. Two points were corrected relative to the source changelog wording:

  • env and SELF from cloudflare:test are deprecated, not removed — they are still exported (with @deprecated JSDoc) in both 0.13.0 and 0.16.18, so migration is recommended rather than required. fetchMock, by contrast, is genuinely removed.
  • The codemod transforms only defineWorkersProject. Both defineWorkersProject and defineWorkersConfig were removed from the API, but a config using defineWorkersConfig must be migrated by hand.

Documentation checklist

  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/workers/ @cloudflare/workers-docs, @GregBrimble, @irvinebroque, @mikenomitch, @korinne, @WalshyDev, @cloudflare/deploy-config, @cloudflare/product-owners, @cloudflare/wrangler, @MattieTK, @cloudflare/dev-plat-leads, @vy-ton

@ask-bonk ask-bonk Bot added documentation Documentation edits content:new Request for new/missing content labels Jun 23, 2026

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Posted 2 inline suggestions.

  • MEDIUM src/content/docs/workers/testing/vitest-integration/migration-guides/migrate-from-vitest-3-to-vitest-4.mdx:62 — Directional language ("below") violates the style guide.
  • LOW src/content/docs/workers/testing/vitest-integration/migration-guides/migrate-from-vitest-3-to-vitest-4.mdx:22 — Sentence can be tightened for clarity.

Consider using a permalink with a full commit hash for the GitHub example link on line 119, since main branch links can break if the fixture is reorganized.

@ask-bonk

ask-bonk Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review complete.

Labels applied: documentation, product:workers, content:new

Validation run: pnpm run check passed with 0 errors related to this change.

Posted review: PR #31648 review

The PR is technically accurate and well-structured. I found two minor style items to address:

  • MEDIUM — Line 62 uses directional language ("below"), which the style guide prohibits.
  • LOW — Line 22 can be tightened for clarity.

I also noted that the GitHub example link on line 119 points to main rather than a permalink with a commit hash, so it may break if the fixture is reorganized in the future.

github run

@MattieTK
MattieTK marked this pull request as ready for review June 23, 2026 23:19
@MattieTK
MattieTK requested a review from edmundhung June 23, 2026 23:19
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ Part of the review could not complete in commit d14dbdb — it will retry on the next push.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

✅ No code review issues found.

Style Guide Review

❌ This review could not complete this run; results may be incomplete. It will retry on the next push.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.


`@cloudflare/vitest-pool-workers` v0.13.0 adds support for [Vitest 4](https://vitest.dev/blog/vitest-4). v0.12.x is the last version to support Vitest 3.x. It continues to work if you are not ready to migrate.

Version 0.13.0 rearchitects the integration around a Vite plugin model. This change breaks the configuration API, but it also resolves a number of issues that were not fixable under the previous architecture:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Love it

@MattieTK
MattieTK merged commit 663c0b7 into production Jun 25, 2026
19 checks passed
@MattieTK
MattieTK deleted the vitest-pool-workers-migrate-to-vitest-4 branch June 25, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content:new Request for new/missing content documentation Documentation edits product:workers Related to Workers product size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants