Minor Changes
-
#15117
f0c9c66Thanks @edmundhung! - Support Workerd's new module registry in Workers Vitest testsThe pool now follows Workerd's V2 module fallback protocol when
new_module_registryis selected while retaining the V1 path forlegacy_module_registry. Tests using the new registry preserve URL-basedimport.metabehavior and load CommonJS dependencies as native CommonJS modules with named exports. -
#15272
c921b3fThanks @penalosa! - Add an experimentalnewConfigoption for loading the Worker's configuration fromcloudflare.config.tsProjects that have migrated to the new TypeScript configuration format had no way to run their Vitest suite against their real bindings, since there was no Wrangler configuration file left to point
wrangler.configPathat. This adds the missing option, modelled on@cloudflare/vite-plugin'sexperimental.newConfig:import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject } from "vitest/config"; export default defineProject({ plugins: [cloudflareTest({ experimental: { newConfig: true } })], });
newConfig: trueloadscloudflare.config.tsfrom the project root; pass{ configPath: "..." }to load it from elsewhere. Config functions are called withctx.modeset to Vite's mode, which defaults to"test"and can be overridden with--mode.experimental.newConfigcannot be combined withwrangler.This is experimental and may change without a major version bump. Wrangler environments,
wrangler.config.tstooling configuration, and type generation are not supported yet.
Patch Changes
-
#15293
7a9b8a7Thanks @thatsKevinJain! - Fix "Network connection lost" when multiple test files use remote bindingsRemote proxy sessions are shared across pool workers by Wrangler config path, but were disposed during each test file's teardown. Because Vitest starts the next file's worker before the previous one finishes stopping, later files reused an already-disposed session and failed with "Network connection lost". Sessions are now disposed only once the last pool worker stops.
-
Updated dependencies [
aa54b49,4a67a28,2d78137,04e8564,d1cc3af,693ca29,693ca29,693ca29,daefb3c,37ed753,f76b68e,ad89456,c809851,c66d2d5,693ca29,74de3ab,0cb8690,9fcb1c9,22182da,a4c3458,433fa98,d589d30,dd5148d,82d11fc]:- miniflare@5.20260825.0-alpha
- wrangler@4.126.0