Checks the API Worker's request-body bounds, write quotas and local runtime behavior without touching GitHub or deployed storage.
worker_body_test.jscovers streamed body limits, JSON validation, CORS on refusals, upload overflow and quota refusals.worker_quota_test.jscovers the SQLite quota store's atomic admission and rollback.worker_mods_test.jscovers every/mods/*route against in-memory R2 and SQLite-backed Durable Object doubles: a unit begun, its files sent in archives and in parts, status, the manifest, blob and archive reads with ranges (an archive read in a few long ranges), the manifest and archive checks and their one-sentence refusals, signed claims with revs and releases, the 24-hour deletion delay and the purge, pack slack and the compaction's switch, a remix's second claim, moderation (block, unblock, release-ref), the first-come account name and forget-key, asked paths, per-key and per-address limits, repair of a missing pack, the retired routes (410), refusal of incompatible schemas, and protection against bulk reset.worker_contract_test.jsruns, under Miniflare, every exchange the product's map-content client makes, in the shapecontract/client.jsonrecords from the product's source and from a run of its own client (tests/unit_roundtrip.cthere), signed as the product signs, and checks each answer against what the client accepts.worker_runtime_test.jsruns the Worker under Miniflare with local KV, R2 and Durable Objects, checking concurrent per-account quotas, persistence across restarts, preservation of all five legacy bundle tables and established sessions and media across a registry cutover, and a unit's upload (an archive and a file in parts), reads and claims across a restart.worker_purge_test.jsruns, under Miniflare with a short localMODS_DELETE_DELAY_MS, a map published, unpublished and purged through the scheduled handler, and checks the store's stats and its bucket are empty afterwards; that a file another unit still names survives the purge of one, its pack compacted to the live blobs (no slack left, the live unit's archive byte-identical whole and across a ranged download, the old object deleted a delay later); that a unit claimed again within its delay is kept; and that without the variable the purge keeps 24 hours.worker_rows_test.jsmeasures, under Miniflare, the rows the mod store's Durable Objects write (as the platform counts them,api/sql_meter.js) for a map publish of one unit of N files and a player's download of it in one request, against the file-by-file download it replaced. It is a measurement, not run by CI:node tests/worker_rows_test.js build/worker-tests/node_modules/miniflare [files] [worker root].
From the repository root, with Node 22.13 or newer:
node tests/worker_body_test.js
node tests/worker_quota_test.js
node tests/worker_mods_test.js
npm install --prefix build/worker-tests --no-audit --no-fund --no-package-lock [email protected]
node tests/worker_runtime_test.js build/worker-tests/node_modules/miniflare
node tests/worker_contract_test.js build/worker-tests/node_modules/miniflare
node tests/worker_purge_test.js build/worker-tests/node_modules/miniflare
CI runs all six. When the product's client changes, record its exchanges again (contract/README.md) and update contract/client.json with the Worker change that follows it. Preserve fixture data unless intentionally changing the case it represents.