testing/assertions.ts view source
(errors: RouteErrorMap, jsonrpc: boolean, response: Response, label: string): Promise<void> import {assert_error_response_declared} from '@fuzdev/fuz_app/testing/assertions.js'; Assert that a response is not an error its route leaves undeclared: a JSON
body at an error status must be at a status the route's error map declares
and parse against it, by the rule the DEV error check runs
(check_route_error — a 500 internal_error and a 503
service_unavailable always accepted, a JSON-RPC error envelope on a
jsonrpc route not a REST error body). A success status or a non-JSON
response passes.
errors
the route's error map
jsonrpc
whether the route answers JSON-RPC envelopes (RouteSpec.jsonrpc)
booleanresponse
the response, read through a clone
Responselabel
what names the request in a failure
stringreturns
Promise<void>
throws
Error- on a JSON error the route's map doesn't declare