Skip to content

Testing

Last reviewed: 2026-06-30

The suite is layered so behavior is tested at the cheapest tier that can catch real failures.

Terminal window
npm run docs:check
npm run docs:build
npm run worker:assets
npm run typecheck
npm test

Dashboard or Worker build changes may also require:

Terminal window
npm run dashboard:build
npm run dashboard:quality
Tier Files Purpose
Unit worker/test/*.unit.test.ts Pure logic, mappers and validators.
Integration worker/test/*.integration.test.ts Worker routes plus storage/modules in process.
Contract worker/test/*.contract.test.ts OpenAPI, schemas, bridge and split-surface contracts.
E2E worker/e2e/*.e2e.test.ts Wrangler/workerd artifact smoke tests.
  • Do not fake validation, logs, screenshots, API responses or reviewer results.
  • Assert observable outcomes rather than mock call counts when state or response data is available.
  • Keep tenant/app isolation negative tests close to code that touches scoped data.
  • Never weaken existing assertions to make a change pass.