跳到主内容
精选85Cloudflare Workers(Changelog)云与平台

Workers Vitest 集成 v1:包更名并需迁移

Workers - @cloudflare/vitest-pool-workers is now @cloudflare/vitest-plugin

原文
推荐理由

正在用 Workers Vitest 集成写测试的开发者注意:包名改了,配置 API 没变但依赖、导入和 TS 类型都要跟着迁。跑一下官方 codemod 就能自动改完,别手动漏改。

Version 1 of the Workers Vitest integration is published as @cloudflare/vitest-plugin ↗. The package was formerly named @cloudflare/vitest-pool-workers.

Workers Vitest 集成的第1版已发布为 @cloudflare/vitest-plugin ↗。该包以前名为 @cloudflare/vitest-pool-workers。

The Vitest configuration API is unchanged. Existing projects must update the dependency name, package imports, and TypeScript types entries.

Vitest 配置 API 保持不变。现有项目必须更新依赖名称、包导入和 TypeScript 类型条目。

To migrate automatically, run:

要自动迁移,请运行:

npmyarnpnpm

npmyarnpnpm

代码 · 1
npx @cloudflare/codemods vitest:pool-workers-to-vitest-plugin
代码 · 1
npx @cloudflare/codemods vitest:pool-workers-to-vitest-plugin
代码 · 1
yarn @cloudflare/codemods vitest:pool-workers-to-vitest-plugin
代码 · 1
yarn @cloudflare/codemods vitest:pool-workers-to-vitest-plugin
代码 · 1
pnpm @cloudflare/codemods vitest:pool-workers-to-vitest-plugin
代码 · 1
pnpm @cloudflare/codemods vitest:pool-workers-to-vitest-plugin

The codemod updates your dependency, imports, and test TypeScript configuration. For manual migration steps, refer to Migrate to Vitest plugin.

代码修改工具会更新您的依赖、导入和测试 TypeScript 配置。有关手动迁移步骤,请参阅“迁移到 Vitest 插件”。

For outbound request mocks in Workers tests, use the @msw/cloudflare ↗ integration. Refer to Mock outbound requests.

对于 Workers 测试中的出站请求模拟,请使用 @msw/cloudflare ↗ 集成。请参阅“模拟出站请求”。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

另一事件,读法相近