cloudflare/workers-sdk @cloudflare/vitest-pool-workers@0.16.20
cloudflare/workers-sdk
Captured source
source ↗@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
- #14398 `c5014cc` Thanks @apeacock1991! - Add
evictDurableObjectandevictAllDurableObjectstest helpers tocloudflare:test
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();- #14394 `8a5cf8c` Thanks @Partha-Shankar! - fix(d1): escape
migrationsTableNameand filenames in SQLite queries
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"tablewould produce invalid SQL inCREATE TABLE,SELECT, andINSERTstatements, and - A migration filename containing an apostrophe (e.g.
what's-new.sql) would break theINSERT INTO ... VALUES ('...')statement appended after each migration inwrangler.
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.
- Updated dependencies [`5f40dd5`, `34e0cef`, `3b743c1`, `daa5389`, `8a5cf8c`]:
- wrangler@4.105.0
- miniflare@4.20260625.0
Notability
notability 2.0/10Routine minor release of a testing utility.