worker/test
Helpers for the Worker's tests (the tests themselves sit beside their
sources, as src/*.test.ts). Outside src/, so the Worker's type check and
bundle never see them.
| File | What it is |
|---|---|
kv.ts | memoryKV(): a KV namespace in memory that records each put and its options (TTL, metadata). |
budget.ts | memoryBudgets(limit): the BUDGET namespace, one JevBudget's counting (src/budget-counter.ts) per name, each on its own in-memory SQLite, as a Durable Object's ctx.storage.sql. |
authenticator.ts | authenticator(): a passkey in software (ES256, none attestation) that answers the Worker's registration and sign-in options as a browser would, so auth.test.ts runs real signatures through the real library. |
r2.ts | memoryR2(): an R2 bucket in memory (put, get, delete, list). |
tab-hubs.ts | memoryTabHubs(): the TAB_HUB namespace, a hub per user holding the tabs a test opens. |
d1.ts | testD1(): a D1 database in memory (Node's node:sqlite) with every migration in ../migrations/ applied, so a test runs the Worker's real SQL against the real schema. |