ReleaseCloudflare (Workers AI)Cloudflare (Workers AI)published Jun 25, 2026seen 17h

cloudflare/workers-sdk @cloudflare/vitest-pool-workers@0.16.20

cloudflare/workers-sdk

Open original ↗

Captured source

source ↗
published Jun 25, 2026seen 17hcaptured 17hhttp 200method plain

@cloudflare/vitest-pool-workers@0.16.20

Repository: cloudflare/workers-sdk

Tag: @cloudflare/vitest-pool-workers@0.16.20

Published: 2026-06-25T13:25:46Z

Prerelease: no

Release notes:

Patch Changes

These helpers let you exercise how a Durable Object behaves across evictions in your tests. Eviction is graceful: durable storage is preserved, in-memory state is reset by tearing down the instance, hibernatable WebSockets are hibernated rather than closed, and eviction waits for in-flight requests to drain.

import { evictDurableObject, evictAllDurableObjects } from "cloudflare:test";
import { env } from "cloudflare:workers";

const id = env.COUNTER.idFromName("my-counter");
const stub = env.COUNTER.get(id);

// Evict the Durable Object instance pointed to by a specific stub
await evictDurableObject(stub);
await evictDurableObject(stub, { webSockets: "close" });

// Evict all currently-running Durable Objects in evictable namespaces
await evictAllDurableObjects();

D1 migration commands in both wrangler and @cloudflare/vitest-pool-workers interpolated the migrationsTableName config value and migration filenames directly into SQL strings without any escaping. This meant:

  • A table name such as my"table would produce invalid SQL in CREATE TABLE, SELECT, and INSERT statements, and
  • A migration filename containing an apostrophe (e.g. what's-new.sql) would break the INSERT INTO ... VALUES ('...') statement appended after each migration in wrangler.

Both identifiers are now properly escaped before interpolation: migrationsTableName is wrapped in double-quotes with internal double-quotes doubled (SQL-standard identifier quoting), and migration filenames used as string literals have their single-quotes doubled before insertion.

Notability

notability 2.0/10

Routine minor release of a testing utility.