testing/cross_backend/bench/scenario.ts view source
BenchScenario import type {BenchScenario} from '@fuzdev/fuz_app/testing/cross_backend/bench/scenario.js'; One benchmarkable wire scenario. The run body is the Benchmark task fn:
it must throw on a non-success response so the benchmark records a failed
iteration rather than timing an error path as if it succeeded.
Scenarios should be idempotent — they run thousands of times against a single bootstrapped backend with no reset between iterations. Prefer reads; a mutating scenario must not accumulate unbounded state.
name
Scenario name (groups the per-backend results in the report).
type string
requires?
Optional capability gate — return false to skip this scenario on a
backend that can't serve it (e.g. a WS scenario needs capabilities.ws).
type (capabilities: BackendCapabilities) => boolean
run
The timed body. Throws on a non-success response.
type (ctx: BenchScenarioContext) => Promise<void>