Cloudflare renames Vitest integration package to @cloudflare/vitest-plugin – migration guide

Cloudflare announced that the Vitest integration for Workers, previously distributed as @cloudflare/vitest-pool-workers, is now published under the name @cloudflare/vitest-plugin. This is a simple rename; the underlying Vitest configuration API remains unchanged.

What you need to update

  • Replace the dependency name in package.json with @cloudflare/vitest-plugin.
  • Update any import statements that reference the old package.
  • Adjust the TypeScript types entry if you have it configured.

Automatic migration with a codemod

Cloudflare provides a codemod that rewrites your project files for you. Run one of the following commands depending on your package manager:

# npm
npx @cloudflare/codemods vitest:pool-workers-to-vitest-plugin

# yarn
yarn @cloudflare/codemods vitest:pool-workers-to-vitest-plugin

# pnpm
pnpm @cloudflare/codemods vitest:pool-workers-to-vitest-plugin

The codemod updates the dependency, import paths, and TypeScript configuration in one pass.

Manual migration

If you prefer to make changes yourself, refer to Cloudflare’s “Migrate to Vitest plugin” documentation for step‑by‑step instructions.

Mocking outbound requests

When testing Workers that make external HTTP calls, use the @msw/cloudflare integration to mock those requests. See the “Mock outbound requests” guide for details.

Summary

The rename does not affect functionality, but updating the package name and imports is required. Using the provided codemod is the quickest way to stay up‑to‑date.