testing/middleware_gate_probes.ts view source
(probe: MiddlewareGateProbe, response: Response, collector: ErrorCoverageCollector, route_specs: RouteSpec[]): Promise<...> import {assert_middleware_gate_refusal} from '@fuzdev/fuz_app/testing/middleware_gate_probes.js'; Assert a probe was refused as its route declares, then record the refusal
in collector, which checks the body against the route's map.
probe
the probe sent
response
its response
Responsecollector
the error coverage to record the refusal in
route_specs
the routes the collector resolves the path against
RouteSpec[]returns
Promise<void>
throws
AssertionError- when the response's status or `error` code isn't the declared refusal, or its body is off the route's map
mutates
collector— records the probe's route, status and code