testing/assertions.ts view source
(lookup: Map<string, Partial<Record<number, ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>>>, route: AppSurfaceRoute, status: number, body: unknown): void Assert that an error schema exists for a route+status and validate the body against it.
Protected routes should always have auto-derived error schemas (401 for authenticated, 403 for role-restricted). A missing schema indicates a gap in error schema derivation.
lookup
map from "METHOD /path" to merged error schemas
Map<string, Partial<Record<number, ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>>>route
the surface route to validate against
status
expected HTTP status code
numberbody
the parsed response body to validate
unknownreturns
void