Cloudflare renamed its Workers Vitest package on 19 August 2026 and the mocking rewrite is what breaks

The rename is a codemod. The mocking rewrite is a rewrite, and Cloudflare's launch install command broke a peer range.

Read time
12 min
Word count
2K
Sections
11
FAQs
8
Share
Cloudflare Workers Vitest package rename to @cloudflare/vitest-plugin 1.0.0, published on npm 20 August 2026
@cloudflare/vitest-plugin 1.0.0 replaced @cloudflare/vitest-pool-workers on 19-20 August 2026.
On this page · 11 sections
  1. What Cloudflare actually shipped
  2. The part that is not a rename
  3. What you are actually taking a dependency on
  4. Who this hits, and how to tell if it is you
  5. The known issues survive the rename
  6. What to do before you migrate
  7. What is still unknown
  8. India-specific considerations
  9. FAQ
  10. How eCorpIT can help
  11. References

Summary. Cloudflare announced on 19 August 2026 that @cloudflare/vitest-pool-workers is now @cloudflare/vitest-plugin, and published version 1.0.0 to npm the next day at 17:42 UTC. The changelog says "The Vitest configuration API is unchanged," and for imports and configuration that is accurate. It is not accurate for outbound request mocking, which was removed from the package and replaced with two third-party dependencies: msw at version 2.14 or later at launch (version 3 or later as of 30 November 2026), plus @msw/cloudflare, which was at version 0.0.1 at launch (published 30 June 2026) and carried no licence on its GitHub repository. At launch, Cloudflare's documented install command asked for msw@^2.14.0; the @msw/cloudflare package declared a peer range of >=2.14.1, so the lowest version Cloudflare's own command permitted violated the dependency it installed alongside. That mismatch has since gone: as of 30 November 2026 the docs ask for msw 3.0.0 or later, and @msw/cloudflare 0.2.0 requires msw 3. At launch the old package was not deprecated either: @cloudflare/vitest-pool-workers resolved to 0.22.0, published 18 August 2026, two days before its stated replacement existed. npm now marks it deprecated, and its last version is 0.23.0 from 7 October 2026. Teams on the Workers Paid plan, which starts at $5 USD per month per account, will find the codemod handles the rename in one command and handles none of this.

What Cloudflare actually shipped

The changelog post is dated 19 August 2026. It states that version 1 of the Workers Vitest integration is published as @cloudflare/vitest-plugin, that the package was formerly named @cloudflare/vitest-pool-workers, and that "Existing projects must update the dependency name, package imports, and TypeScript types entries."

The npm registry tells a slightly different story about timing. The @cloudflare/vitest-plugin package was created on 20 August 2026 at 14:33 UTC with a placeholder 0.0.0, and 1.0.0 landed at 17:42 UTC the same day. The changelog is dated a day before the artefact it points at.

Version 1.0.0 declares peer dependencies on vitest, @vitest/runner and @vitest/snapshot at ^4.1.0, so this is Vitest 4 only. Its runtime dependencies include wrangler 4.125.0, esbuild 0.28.1, zod 4.4.3, cjs-module-lexer 1.2.3, and miniflare at 5.20260820.0-alpha. A package labelled 1.0.0 pinned to an alpha build of the runtime it drives is worth noticing before you promote it into a release branch. By 1.10.1, published 29 November 2026, the pin had moved to a beta build, 5.20261127.1-beta, and the Vitest peer range had widened to Vitest 4.1 or Vitest 5.

The rename map

The mechanical part is small and the codemod covers all of it.

Location Before After
package.json dependency @cloudflare/vitest-pool-workers @cloudflare/vitest-plugin
Version range in the docs example ^0.16.0 ^1.0.0
Import specifier import { cloudflareTest } from "@cloudflare/vitest-pool-workers" import { cloudflareTest } from "@cloudflare/vitest-plugin"
tsconfig types entry ["@cloudflare/vitest-pool-workers/types"] ["@cloudflare/vitest-plugin/types"]
Subpath imports @cloudflare/vitest-pool-workers/config @cloudflare/vitest-plugin/config
Vitest configuration API unchanged unchanged

Cloudflare ships a codemod: npx @cloudflare/codemods vitest:pool-workers-to-vitest-plugin, with --dry-run to preview and --files <glob> to limit scope. Yarn and pnpm variants are documented. The codemod updates the dependency, the imports and the test TypeScript configuration.

One detail in the manual migration diff is already stale. The guide's before-and-after shows "@cloudflare/vitest-pool-workers": "^0.16.0", but the last published version of that package is 0.23.0, released on 7 October 2026. If you are on a current pool-workers install, the diff you are asked to copy does not match your package.json.

The part that is not a rename

The changelog closes with one line: "For outbound request mocks in Workers tests, use the @msw/cloudflare integration." That sentence is doing a lot of work.

Check the Test APIs reference, last updated 20 August 2026. Its cloudflare:test export list covers events, queues, Durable Objects, D1 and Workflows: createExecutionContext(), waitOnExecutionContext(), createScheduledController(), createMessageBatch(), runInDurableObject(), applyD1Migrations(), introspectWorkflow() and the rest. There is no fetch-mocking export in that list at all. The declarative outbound mock that used to live in the package is gone from the documented surface.

At launch the replacement was this two-package install; as of 30 November 2026 the docs ask for msw@^3.0.0 instead:


            npm i -D msw@^2.14.0 @msw/cloudflare
          

Then a shared network mock, a Vitest setup file, and MSW request handlers:


            import { setupNetwork } from "@msw/cloudflare";

export const network = setupNetwork();
          

            import { afterAll, afterEach, beforeAll } from "vitest";
import { network } from "./network";

beforeAll(() => network.enable());
afterEach(() => network.resetHandlers());
afterAll(() => network.disable());
          

Individual tests then call network.use() with MSW's http.get() and HttpResponse.json(). WebSocket mocks use MSW's ws.link() API. It is a reasonable design. It is not "unchanged."

The peer range does not line up

This was the checkable defect at launch. Cloudflare's documented install was msw@^2.14.0. The caret range admitted 2.14.0 itself. But @msw/cloudflare@0.0.1 declares peerDependencies: { "msw": ">=2.14.1" }. Version 2.14.0 satisfied Cloudflare's instruction and failed the package's own peer requirement.

In practice most lockfile-free installs at the time pulled msw 2.15.0, published 8 July 2026, and nothing complained. A pinned or resolution-constrained monorepo that landed on 2.14.0 got a peer warning or, under strict pnpm settings, an install failure, pointing at a package the developer did not choose. The fix then was to write msw@^2.14.1. Since then, msw 3.0.0 and @msw/cloudflare 0.2.0 both shipped on 28 September 2026; the bridge now requires msw 3 or later, and Cloudflare's docs ask for msw 3, so new installs line up. The risk has flipped: a project that kept msw 2.x with a floating @msw/cloudflare range will now pull 0.2.0 and hit the reverse peer conflict.

What you are actually taking a dependency on

Before this rename, mocking outbound requests in a Workers test suite was Cloudflare's problem. After it, it is Mock Service Worker's problem, and specifically a very young bridge package's problem.

Package Latest version (30 Nov 2026) Published Repository signal
@cloudflare/vitest-plugin 1.10.1 29 Nov 2026 Cloudflare workers-sdk monorepo
@cloudflare/vitest-pool-workers 0.23.0 7 Oct 2026 deprecated on npm, no further updates
msw 3.0.8 26 Nov 2026 mswjs/msw, 18,371 stars, MIT licence
@msw/cloudflare 0.2.0 28 Sep 2026 mswjs/cloudflare, 96 stars, MIT in package.json but no licence file, two releases
@mswjs/interceptors ^0.45.5 transitive pulled in by @msw/cloudflare

msw itself is mature and MIT-licensed. The bridge is not the same animal. The mswjs/cloudflare repository was created on 22 April 2026, was last pushed on 28 September 2026, has published two GitHub releases (0.1.0 and 0.2.0), and still returns null for its licence field through the GitHub API, because the repository has no licence file, even though the npm package metadata declares MIT. Cloudflare made it the documented path on 19 August 2026, six weeks after what was then its last commit.

For a team with a legal review step on third-party code, "no licence declared" is not a footnote. Absence of a licence is not permission; it is the default of reserved rights. That review should happen before the codemod runs, not after a security questionnaire asks about it.

The package README still advertises the removed feature

Open the npm page for @cloudflare/vitest-plugin 1.0.0 (the 1.10.1 README is the same on this point) and its README lists seven bullets, one of which reads: "Provides a declarative interface for mocking outbound requests." Open the Vitest integration landing page in Cloudflare's docs, last updated 20 August 2026, and the same bullet list appears with six items. The mocking bullet is not there.

The same release ships a README claiming a capability its own documentation removed. If you are evaluating the package from npm rather than from the docs site, that is the line you will read.

Who this hits, and how to tell if it is you

You are affected if any of the following is true.

Your package.json contains @cloudflare/vitest-pool-workers. Nothing breaks immediately, because the old package still installs and its latest tag resolves to 0.23.0. But npm now marks it deprecated with a notice that it will receive no future updates, so fixes land only in the renamed package.

Your test suite mocks outbound fetch calls from a Worker. This is the group with real work to do. The rename is a codemod; the mock rewrite is a rewrite of every mocked call site plus a new setup file.

You are still on Vitest 3. The plugin requires Vitest ^4.1.0, and the current 1.10.1 also accepts Vitest 5. Cloudflare's separate Vitest 3 to Vitest 4 guide covers the move from v0.12.x to v0.13.x of the old package, and you need to be through that before the rename is even relevant.

You run pnpm with strict peer resolution in a monorepo. Check the msw version your lockfile actually resolves before you copy the documented install command.

The known issues survive the rename

None of these are new, and none of them are fixed by moving to 1.0.0. The known issues page, last updated 20 August 2026, still lists all of them.

Area Constraint Workaround
Coverage Native V8 coverage is not supported Use instrumented coverage via Istanbul
Fake timers Vitest fake timers do not apply to KV, R2 or cache simulators Do not expire a KV key by advancing fake time
Dynamic import() Fails inside export default {} handlers with exports.default.fetch() and inside Durable Object handlers Import handlers directly, or use static top-level imports
WebSockets Not supported with Durable Objects under per-file storage isolation Run with --max-workers=1 --no-isolate
Storage isolation Isolation is per test file; writes are undone at file end Await every storage promise; consume response bodies

That last row causes more flaky-test tickets than anything else on the list. Storage writes that are not awaited, and fetch or R2.get() response bodies that are never consumed, produce failures that move when you reorder the file.

What to do before you migrate

Run the codemod with --dry-run first and read the diff. It touches package.json, imports and tsconfig types, and nothing else.

Install msw@^3.0.0 with @msw/cloudflare 0.2.0 or later, which is what Cloudflare's docs ask for as of 30 November 2026. If you followed the launch instructions and are still on msw 2.x, do not let the bridge float: 0.2.0 requires msw 3, so either move both packages together or hold @msw/cloudflare at 0.1.0 until you can.

Pin @msw/cloudflare. At 0.2.0, with two releases and an MIT declaration in its package metadata but no licence file in the repository, a floating range on that package is an unforced risk, as the jump to requiring msw 3 showed. Pin the exact version, record it in your dependency review, and put a calendar note to re-check the licence field.

Treat the miniflare pre-release pin (a beta build in 1.10.1) as a reason to keep the old package installable for a rollback window. @cloudflare/vitest-pool-workers 0.23.0 is deprecated but still installs, so a revert is a package.json edit rather than an archaeology exercise.

If your Worker's cost profile is what pushed you toward heavier local testing in the first place, the arithmetic has not changed: Workers Paid is a $5 USD per month minimum per account, with 10 million requests included and $0.30 per additional million, plus 30 million CPU milliseconds included and $0.02 per additional million. Local test runs are free; the mistakes they catch are not.

What is still unknown

As of 30 November 2026, npm marks @cloudflare/vitest-pool-workers as deprecated, with a notice that it will receive no future updates, but Cloudflare has not stated an end-of-support date or a support window for the 0.x line.

Nor has Cloudflare said whether @msw/cloudflare will get a 1.0, a licence file, or a formal support commitment. It is a Mock Service Worker repository, not a Cloudflare one, and the changelog links to it without qualification.

India-specific considerations

For Indian product teams shipping to regulated buyers, the licence gap is the item to escalate, not the rename. A software bill of materials that lists a dependency with no declared licence will stall a bank or insurer procurement review, and under the Digital Personal Data Protection Act 2023 the accountability for processing sits with the data fiduciary regardless of which upstream package introduced the exposure. Record the pinned version and the date you checked the licence field, so the answer to "when did you last review this" is a date rather than a shrug.

Test tooling migrations are also where offshore delivery teams lose a sprint quietly: the codemod runs green, CI stays green, and the mock rewrite is discovered three weeks later when someone adds a test that calls an external API. Audit for mocked outbound calls before you schedule the work, not after.

FAQ

How eCorpIT can help

Migrations like this fail quietly: the codemod goes green, CI stays green, and the mocked-call rewrite surfaces weeks later. Our QA and test automation practice audits an existing suite for mocked outbound calls, pins and reviews new third-party test dependencies, and runs the cutover behind a rollback window. We work the same way on Cloudflare Workers and Durable Objects delivery and on npm supply-chain policy, where a young package with no licence file is exactly the kind of item a buyer's security review stops on. eCorpIT is CMMI Level 5 and ISO 27001:2022 certified, and we design dependency review aligned with the evidence a regulated buyer asks for. Book a test-suite migration review if you want the audit done before the sprint is committed. Our wider software testing work covers the same ground for teams outside the Workers platform.

References

  1. Cloudflare changelog: @cloudflare/vitest-pool-workers is now @cloudflare/vitest-plugin, 19 August 2026
  1. Cloudflare Workers docs: Migrate to Vitest plugin
  1. Cloudflare Workers docs: Mock outbound requests
  1. Cloudflare Workers docs: Vitest integration overview
  1. Cloudflare Workers docs: Test APIs reference
  1. Cloudflare Workers docs: Vitest integration known issues
  1. Cloudflare Workers docs: Isolation and concurrency
  1. Cloudflare Workers docs: Migrate from Vitest 3 to Vitest 4
  1. Cloudflare Workers docs: Workers pricing
  1. npm registry: @cloudflare/vitest-plugin
  1. npm registry: @cloudflare/vitest-pool-workers
  1. npm registry: @msw/cloudflare
  1. npm registry: msw
  1. GitHub: mswjs/cloudflare
  1. GitHub: mswjs/msw

Last updated 30 November 2026.

Frequently asked

Quick answers.

01 What did Cloudflare change on 19 August 2026?
Cloudflare renamed the Workers Vitest integration package from @cloudflare/vitest-pool-workers to @cloudflare/vitest-plugin and published version 1.0.0 to npm on 20 August 2026. The Vitest configuration API is unchanged, but outbound request mocking moved out of the package entirely and into two third-party dependencies.
02 Does the codemod handle the whole migration?
No. The codemod npx @cloudflare/codemods vitest:pool-workers-to-vitest-plugin updates the dependency name, package imports and TypeScript types entries. It does not rewrite outbound request mocks, which now require installing msw and @msw/cloudflare and adding a Vitest setup file that enables and resets the network mock.
03 What was wrong with Cloudflare's documented install command?
At launch the docs said to install msw@^2.14.0. The caret range permitted msw 2.14.0, but @msw/cloudflare 0.0.1 declared a peer dependency of msw >=2.14.1. As of 30 November 2026 the docs ask for msw@^3.0.0 and @msw/cloudflare 0.2.0 requires msw 3 or later, so new installs line up. Projects still on msw 2.x should upgrade both packages together or hold @msw/cloudflare at 0.1.0.
04 Is the old package deprecated?
Yes. As of 30 November 2026 npm marks @cloudflare/vitest-pool-workers as deprecated and says it will receive no future updates; its last version is 0.23.0, published 7 October 2026. It still installs, so a rollback remains a one-line change, but Cloudflare has published no end-of-support date.
05 Which Vitest version does the new plugin require?
Version 1.0.0 declares peer dependencies on vitest, @vitest/runner and @vitest/snapshot at ^4.1.0, so Vitest 4 is required; 1.10.1, published 29 November 2026, also accepts Vitest 5. Teams still on Vitest 3 need Cloudflare's separate migration guide covering v0.12.x to v0.13.x of the old package before the rename applies to them.
06 Why does the licence matter for @msw/cloudflare?
The GitHub API returns a null licence field for mswjs/cloudflare, which was created on 22 April 2026 and last pushed on 28 September 2026. The npm package metadata declares MIT, but with no licence file in the repository there is no licence text to cite, and rights are reserved by default where no licence is granted. Procurement and security reviews at regulated buyers treat an unlicensed dependency as a blocking finding rather than a note.
07 Do the known issues change with version 1.0.0?
No. The known issues page, last updated 20 August 2026, still lists unsupported native V8 coverage, fake timers that do not affect KV, R2 or cache simulators, broken dynamic imports inside default export handlers, unsupported WebSockets with Durable Objects under per-file isolation, and per-test-file storage isolation.
08 What does the npm README say that the docs do not?
The @cloudflare/vitest-plugin README on npm, from 1.0.0 through 1.10.1, still lists "Provides a declarative interface for mocking outbound requests" among its features. The Vitest integration landing page in Cloudflare's docs, last updated 20 August 2026, carries the same bullet list without that item, because the capability moved to @msw/cloudflare.

About the author

Manu Shukla

Founder & Director

Founder of eCorpIT. Hands-on engineer leading senior-only delivery for AI apps, custom software, and cloud systems for global clients.

Subscribe

One engineering note a week. No fluff, no spam.

Senior-architect playbooks on AI agents, mobile apps, cloud, security, data, and marketing — delivered every Wednesday.

Past the reading

Read enough. Let's build something.

A senior architect responds in 24 working hours with scope, indicative cost, and a timeline. NDA before any technical conversation.

Weekly engineering notes

Enjoying this article? Get one like it every Wednesday.

Senior-architect playbooks on AI agents, mobile apps, cloud, security, data and marketing. Unsubscribe in one click.

We email a link to confirm your address. Privacy

Loading search…

Browse all guides