Change8

@cloudflare/vitest-pool-workers@0.21.2

📦 cloudflare-workersView on GitHub →
2 features🐛 3 fixes🔧 7 symbols

Summary

This patch release updates Node.js compatibility detection to align with workerd's default behavior and resolves issues with `nodejs_compat` flags and type mismatches in testing pools.

Migration Steps

  1. To keep Node.js compatibility switched off on a newer compatibility date, specify both `no_nodejs_compat` and `no_nodejs_compat_v2`.

✨ New Features

  • Detect Node.js compatibility from the compatibility date, now that `nodejs_compat` is enabled by default.
  • The `wrangler types` command no longer attributes its `@types/node` suggestion to "the `nodejs_compat` flag", which it can now make for Workers that do not set the flag at all.

🐛 Bug Fixes

  • Widen `WorkerPoolOptionsContext.inject` type to avoid `ProvidedContext` mismatch when calling `inject()` inside `cloudflareTest()` pool options.
  • Ignore a `nodejs_compat` compatibility flag that the compatibility date already enables, preventing Workers configured with a compatibility date of `2026-08-04` or later and `nodejs_compat` from failing to start locally.
  • The `@cloudflare/vitest-pool-workers` now drops the opt-out for `nodejs_compat` rather than adding the flag back when the compatibility date enables it, preventing projects from running any tests at all.

Affected Symbols