@cloudflare/vitest-pool-workers
0.23.0 · 7 Oct 2026MIT1.8M / weekRepositoryHomepagenpmAtom feed
322 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 0.23.x · latest line
0.23.0
7 Oct 2026- 0.22.x
0.22.0
18 Aug 2026Mocking requests with MSW in Worker tests now requires MSW >= 2.14
@cloudflare/vitest-pool-workerspreviously shipped internal shims to make MSW work inside the workerd runtime. MSW 2.14 added that support natively, so those shims have been removed.If you mock requests with MSW in your Worker tests, make sure you're on MSW
>= 2.14; older versions will no longer intercept requests. You can keep usingsetupServer()frommsw/node, or adopt the official@msw/cloudflareintegration viasetupNetwork(). See the updatedrequest-mockingexample fixture for the recommended pattern.Honor
access.devwhen running Workers with@cloudflare/vitest-pool-workers, soctx.access.getIdentity()returns the configured identity just as it does withwrangler dev.Fix module resolution for relative
require()inside CJS deps when the project path contains spacesWhen a project lives under a directory with a space in its name, externalized CommonJS dependencies that use relative
require()calls (e.g.require("./lib/impl.js")) would fail with "No such module" becauseworkerdpreserves URL encoding in the module name. Encoded module paths are now handled deterministically before CommonJS resolution without altering literal percent sequences.
Minor Changes
Mocking requests with MSW in Worker tests now requires MSW >= 2.14
@cloudflare/vitest-pool-workerspreviously shipped internal shims to make MSW work inside the workerd runtime. MSW 2.14 added that support natively, so those shims have been removed.If you mock requests with MSW in your Worker tests, make sure you're on MSW
>= 2.14; older versions will no longer intercept requests. You can keep usingsetupServer()frommsw/node, or adopt the official@msw/cloudflareintegration viasetupNetwork(). See the updatedrequest-mockingexample fixture for the recommended pattern.
Patch Changes
Honor
access.devwhen running Workers with@cloudflare/vitest-pool-workers, soctx.access.getIdentity()returns the configured identity just as it does withwrangler dev.Fix module resolution for relative
require()inside CJS deps when the project path contains spacesWhen a project lives under a directory with a space in its name, externalized CommonJS dependencies that use relative
require()calls (e.g.require("./lib/impl.js")) would fail with "No such module" becauseworkerdpreserves URL encoding in the module name. Encoded module paths are now handled deterministically before CommonJS resolution without altering literal percent sequences.Restore typed
inject()keys incloudflareTest()pool optionsinject()insidecloudflareTest()options again infers the value type from the keys you declare in your VitestProvidedContext, and reports misspelled keys. For keys that are only provided at runtime, pass an explicit type argument, e.g.inject<number>("myPort").Bump
capnp-esto 0.0.16.Use a fixed default compatibility date rather than the current date
When no compatibility date was set, Wrangler, C3 and the Vitest pool all defaulted to the current date.
workerdonly accepts a compatibility date up to 7 days beyond its own release, so whenever aworkerdrelease was delayed the default could get ahead of the runtime that had been installed, and local development would fail to start.The default is now fixed at the release date of the
workerdversion that ships with each release, which leaves a week of headroom and updates asworkerdis upgraded.@cloudflare/vite-pluginpreviously inlined the date at which it was built. It now shares the same default.
- 0.21.x
0.21.3
13 Aug 2026Only updates dependencies:miniflare 5.20260811.1-alphawrangler 4.123.0
0.21.2
12 Aug 2026Widen
WorkerPoolOptionsContext.injecttype to avoidProvidedContextmismatchPreviously, calling
inject()insidecloudflareTest()pool options could fail with a type error when your project'sProvidedContextaugmentation wasn't visible to the pool plugin. Theinjectparameter now accepts any string key and is generic (inject<T>(key)), defaulting tounknownwhen no type argument is provided. This lets you opt in to concrete types (e.g.inject<number>("port")) while avoiding the cross-copyProvidedContextmismatch that occurred when pnpm resolved separate virtual-store instances of vitest.Ignore a
nodejs_compatcompatibility flag that the compatibility date already enablesworkerd rejects a compatibility flag that its compatibility date enables by default, so a Worker configured with both a compatibility date of
2026-08-04or later andnodejs_compatfailed to start locally with "The compatibility flag nodejs_compat became the default as of 2026-08-04 so does not need to be specified anymore".The redundant
nodejs_compatandnodejs_compat_v2flags are now dropped when starting the runtime, which has no effect on the resulting Worker because the compatibility date enables both anyway.no_nodejs_compatandno_nodejs_compat_v2still switch Node.js compatibility off, and a flag specified alongside its own opt-out is left alone so that workerd still reports those as contradictory.Detect Node.js compatibility from the compatibility date, now that
nodejs_compatis enabled by defaultAs of compatibility date
2026-08-04, workerd enables thenodejs_compatandnodejs_compat_v2compatibility flags by default. Previously these tools only treated Node.js compatibility as enabled when one of those flags was listed explicitly, so a Worker on a compatibility date of2026-08-04or later without the flag would get Node.js APIs from the runtime but no Node.js polyfills from the bundler, andprocess.envcould be substituted with an empty object at build time. They now resolve these flags the same way workerd does, and honourno_nodejs_compatto opt out.To keep Node.js compatibility switched off on a newer compatibility date, specify both
no_nodejs_compatandno_nodejs_compat_v2, since each flag has its own default.@cloudflare/vitest-pool-workersneedsnodejs_compat_v2for its own test runner, so it continues to override a project that opts out of it. On a compatibility date that enables the flag anyway, it now drops the opt-out rather than adding the flag back, which workerd would reject — previously this stopped such a project from running any tests at all.wrangler typesalso no longer attributes its@types/nodesuggestion to "thenodejs_compatflag", which it can now make for Workers that do not set the flag at all.
Patch Changes
Widen
WorkerPoolOptionsContext.injecttype to avoidProvidedContextmismatchPreviously, calling
inject()insidecloudflareTest()pool options could fail with a type error when your project'sProvidedContextaugmentation wasn't visible to the pool plugin. Theinjectparameter now accepts any string key and is generic (inject<T>(key)), defaulting tounknownwhen no type argument is provided. This lets you opt in to concrete types (e.g.inject<number>("port")) while avoiding the cross-copyProvidedContextmismatch that occurred when pnpm resolved separate virtual-store instances of vitest.Ignore a
nodejs_compatcompatibility flag that the compatibility date already enablesworkerd rejects a compatibility flag that its compatibility date enables by default, so a Worker configured with both a compatibility date of
2026-08-04or later andnodejs_compatfailed to start locally with "The compatibility flag nodejs_compat became the default as of 2026-08-04 so does not need to be specified anymore".The redundant
nodejs_compatandnodejs_compat_v2flags are now dropped when starting the runtime, which has no effect on the resulting Worker because the compatibility date enables both anyway.no_nodejs_compatandno_nodejs_compat_v2still switch Node.js compatibility off, and a flag specified alongside its own opt-out is left alone so that workerd still reports those as contradictory.Detect Node.js compatibility from the compatibility date, now that
nodejs_compatis enabled by defaultAs of compatibility date
2026-08-04, workerd enables thenodejs_compatandnodejs_compat_v2compatibility flags by default. Previously these tools only treated Node.js compatibility as enabled when one of those flags was listed explicitly, so a Worker on a compatibility date of2026-08-04or later without the flag would get Node.js APIs from the runtime but no Node.js polyfills from the bundler, andprocess.envcould be substituted with an empty object at build time. They now resolve these flags the same way workerd does, and honourno_nodejs_compatto opt out.To keep Node.js compatibility switched off on a newer compatibility date, specify both
no_nodejs_compatandno_nodejs_compat_v2, since each flag has its own default.@cloudflare/vitest-pool-workersneedsnodejs_compat_v2for its own test runner, so it continues to override a project that opts out of it. On a compatibility date that enables the flag anyway, it now drops the opt-out rather than adding the flag back, which workerd would reject — previously this stopped such a project from running any tests at all.wrangler typesalso no longer attributes its@types/nodesuggestion to "thenodejs_compatflag", which it can now make for Workers that do not set the flag at all.Bump
capnp-esto 0.0.15.Also re-generate the types for the latest
.capnpfiles
0.21.1
11 Aug 2026Report built-in modules that a Worker's compatibility settings don't provide as module errors, instead of crashing workerd
Previously, a Worker whose module graph statically reached a compatibility-gated built-in that wasn't enabled — for example
import "node:child_process"withoutnodejs_compat— took down the runtime with*** Received signal #11: Segmentation faultbefore any test ran. Vitest reported onlyWorker exited unexpectedly, naming neither the module nor the file that imported it, which made the cause very hard to find. The import didn't even have to be called; being reachable from the entrypoint was enough.The module fallback service answered these specifiers with a redirect to the modules root, but workerd already resolves
node:/cloudflare:/workerd:specifiers there, so the redirect pointed back at the module workerd was in the middle of resolving and it recursed until the stack overflowed. Such a specifier only reaches the fallback service when workerd's own registry has already missed, so it's now reported as not found: workerd raisesNo such module "node:child_process", matching whatwrangler devdoes for the same Worker. The accompanying pool error names the module and points at compatibility flags rather than suggesting you bundle it, which can't help for a module built into the runtime.
Patch Changes
Report built-in modules that a Worker's compatibility settings don't provide as module errors, instead of crashing workerd
Previously, a Worker whose module graph statically reached a compatibility-gated built-in that wasn't enabled — for example
import "node:child_process"withoutnodejs_compat— took down the runtime with*** Received signal #11: Segmentation faultbefore any test ran. Vitest reported onlyWorker exited unexpectedly, naming neither the module nor the file that imported it, which made the cause very hard to find. The import didn't even have to be called; being reachable from the entrypoint was enough.The module fallback service answered these specifiers with a redirect to the modules root, but workerd already resolves
node:/cloudflare:/workerd:specifiers there, so the redirect pointed back at the module workerd was in the middle of resolving and it recursed until the stack overflowed. Such a specifier only reaches the fallback service when workerd's own registry has already missed, so it's now reported as not found: workerd raisesNo such module "node:child_process", matching whatwrangler devdoes for the same Worker. The accompanying pool error names the module and points at compatibility flags rather than suggesting you bundle it, which can't help for a module built into the runtime.
0.21.0
10 Aug 2026Update the Workers Vitest pool for Miniflare's config-based options
The Workers Vitest pool now converts the Miniflare options it creates for test sessions to Miniflare's config-based
workersshape.For the most part, users should not expect to notice any changes.
Minor Changes
Update the Workers Vitest pool for Miniflare's config-based options
The Workers Vitest pool now converts the Miniflare options it creates for test sessions to Miniflare's config-based
workersshape.For the most part, users should not expect to notice any changes.
However, auxiliary workers declared in
miniflare.workersthat rely on relative local imports now need those imported modules to be declared explicitly in the migrated module manifest.- 0.20.x
0.20.1 – 0.20.33 releases that only update dependencieswrangler 4.120.0miniflare 5.20260801.1-alphaundici 7.29.0Show each
0.20.0
31 Jul 2026- breaking
Remove several options from the
miniflareoverride optionsThe following options have been removed from the
miniflareoverride options, as they were not intended to be exposed, were not functional, or have been superseded by other options:Additionally,
cachehas been deprecated and renamed tocacheAPI, butcacheremains functional. Preserve the deprecated Miniflare
cacheoptionVitest configurations using
cachecontinue to work after the internal Miniflare v5 upgrade. The option is translated tocacheAPI; new configurations should usecacheAPIdirectly.Stop enabling Miniflare's removed
unsafeStickyBlobsoptionThe pool no longer sets the
unsafeStickyBlobsMiniflare option, which has been removed. This option was only needed for the Durable Object isolated storage feature that was dropped in 0.13.0, so there is no change in behaviour.
Minor Changes
- breaking
Remove several options from the
miniflareoverride optionsThe following options have been removed from the
miniflareoverride options, as they were not intended to be exposed, were not functional, or have been superseded by other options:wrappedBindingscacheWarnUsagefetchMock: you should useoutboundServiceinsteadcontainerEngine: containers were not supported in vitest-pool-workers. Consider usingcreateTestHarness()instead if you want to test against actual containers.
Additionally,
cachehas been deprecated and renamed tocacheAPI, butcacheremains functional.
Patch Changes
Preserve the deprecated Miniflare
cacheoptionVitest configurations using
cachecontinue to work after the internal Miniflare v5 upgrade. The option is translated tocacheAPI; new configurations should usecacheAPIdirectly.Stop enabling Miniflare's removed
unsafeStickyBlobsoptionThe pool no longer sets the
unsafeStickyBlobsMiniflare option, which has been removed. This option was only needed for the Durable Object isolated storage feature that was dropped in 0.13.0, so there is no change in behaviour.
- 0.19.x
0.19.1
30 Jul 2026Only updates dependencies:miniflare 4.20260730.0wrangler 4.116.0
0.19.0
28 Jul 2026Add a
verboseoption tocloudflareTest()andcloudflarePool()configurationSet
verbose: falseto suppress verbose workerd runtime logs, such as caught Durable Object RPC errors. The option defaults totrueto preserve existing output.Ignore workerd's
disconnected: peer disconnected without gracefully ending TLS sessionexception logsWhen tests make real
fetch()calls to external TLS endpoints, servers and load balancers routinely close idle keepalive connections without sending a TLSclose_notify. No request fails — the connection is idle — but workerd logs akj/compat/tls.c++exception with a full stack trace each time, flooding otherwise green test runs. This is the TLS sibling of thedisconnected: ...messages already in the ignore list, so filter it the same way.
Minor Changes
Add a
verboseoption tocloudflareTest()andcloudflarePool()configurationSet
verbose: falseto suppress verbose workerd runtime logs, such as caught Durable Object RPC errors. The option defaults totrueto preserve existing output.
Patch Changes
Ignore workerd's
disconnected: peer disconnected without gracefully ending TLS sessionexception logsWhen tests make real
fetch()calls to external TLS endpoints, servers and load balancers routinely close idle keepalive connections without sending a TLSclose_notify. No request fails — the connection is idle — but workerd logs akj/compat/tls.c++exception with a full stack trace each time, flooding otherwise green test runs. This is the TLS sibling of thedisconnected: ...messages already in the ignore list, so filter it the same way.
- 0.18.x
0.18.8
23 Jul 2026Prevent worker disposal errors from failing otherwise successful test runs
Errors raised while disposing test Workers are now logged for diagnostics rather than overriding the test result. Set
NODE_DEBUG=vitest-pool-workersto view these errors.
Patch Changes
Prevent worker disposal errors from failing otherwise successful test runs
Errors raised while disposing test Workers are now logged for diagnostics rather than overriding the test result. Set
NODE_DEBUG=vitest-pool-workersto view these errors.
0.18.7
21 Jul 2026Reading the note…
0.18.6
17 Jul 2026Reading the note…
0.18.5
15 Jul 2026Reading the note…
0.18.4
9 Jul 2026Reading the note…
0.18.3
9 Jul 2026Reading the note…
0.18.2
7 Jul 2026Reading the note…
0.18.1
7 Jul 2026Reading the note…
0.18.0
2 Jul 2026Reading the note…
- 0.17.x
0.17.0
30 Jun 2026Reading the note…
- 0.16.x
0.16.20
25 Jun 2026Reading the note…
0.16.19
23 Jun 2026Reading the note…
0.16.18
19 Jun 2026Reading the note…
0.16.17
18 Jun 2026Reading the note…
0.16.16
16 Jun 2026Reading the note…
0.16.15
11 Jun 2026Reading the note…
0.16.14
9 Jun 2026Reading the note…
0.16.13
4 Jun 2026Reading the note…
0.16.12
2 Jun 2026Reading the note…
0.16.11
1 Jun 2026Reading the note…
0.16.10
26 May 2026Reading the note…
0.16.9
22 May 2026Reading the note…
0.16.8
21 May 2026Reading the note…
0.16.7
19 May 2026Reading the note…
0.16.6
15 May 2026Reading the note…
0.16.5
14 May 2026Reading the note…
0.16.4
12 May 2026Reading the note…
0.16.3
7 May 2026Reading the note…
0.16.2
7 May 2026Reading the note…
0.16.1
7 May 2026Reading the note…
0.16.0
5 May 2026Reading the note…
- 0.15.x
0.15.2
30 Apr 2026Reading the note…
0.15.1
28 Apr 2026Reading the note…
0.15.0
24 Apr 2026Reading the note…
- 0.14.x
0.14.9
21 Apr 2026Reading the note…
0.14.8
20 Apr 2026Reading the note…
0.14.7
15 Apr 2026Reading the note…
0.14.6
13 Apr 2026Reading the note…