Cloudflare Worker Test Harness
Integration tests for a real Cloudflare Worker build using wrangler's createTestHarness(), which runs your production output in a local preview server and is driven from an ordinary Node test process. Covers getDurableObjectStorage().exec() to seed and assert SQLite rows, evictDurableObject() to prove state survives a teardown, listDurableObjectIds(), getEnv() for direct Durable Object RPC, plus getLogs, clearLogs, reset, and debug. Ships with the Worker under test: a SQLite-backed rate limit Durable Object with an alarm sweep and a declarative exports config.
npx shadcn@latest add @compronents/cloudflare-worker-test-harnessInstalls from ui.aryank.space. Needs a registry token and a one-time @compronents entry in components.json. The docs walk through both.
createTestHarness runs the production Worker build in a local preview; a Node test seeds DO SQLite, evicts, and asserts state survives the teardown.
@cloudflare/[email protected][email protected]