[Workers] Add Vitest 3 to Vitest 4 migration guide for vitest-pool-workers - #31648
Conversation
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
There was a problem hiding this comment.
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.
|
Review complete. Labels applied: Validation run: Posted review: PR #31648 review The PR is technically accurate and well-structured. I found two minor style items to address:
I also noted that the GitHub example link on line 119 points to |
Review
Code ReviewThis 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. CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
|
|
||
| `@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: |
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-workersfrom v0.12.x (Vitest 3) to v0.13.x (Vitest 4): thecloudflareTest()plugin config API, thejscodeshiftcodemod, theisolatedStorage/singleWorkerremoval, the deprecatedcloudflare:testimports (env/SELFmoving tocloudflare:workers), and thefetchMockremoval.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-workers0.13.0and the current0.16.18): the shipped type definitions, the codemod source, and the source PR body. Two points were corrected relative to the source changelog wording:envandSELFfromcloudflare:testare deprecated, not removed — they are still exported (with@deprecatedJSDoc) in both0.13.0and0.16.18, so migration is recommended rather than required.fetchMock, by contrast, is genuinely removed.defineWorkersProject. BothdefineWorkersProjectanddefineWorkersConfigwere removed from the API, but a config usingdefineWorkersConfigmust be migrated by hand.Documentation checklist