import { MockInterceptor } from "https://deno.land/x/deno_mock_fetch@1.0.1/mod.ts";
Defines an interceptor for a Mock.
Instantiated when MockFetch.intercept(...)
is called.
Constructors
Methods
defaultResponseHeaders(headersInit: HeadersInit): MockInterceptor
Set default response headers on the interceptor for subsequent responses
response(body?: BodyInit | null, init?: ResponseInit): MockScope
Mock a request with a defined response.
Set response content length header for responses. Default: off.
At this time, this only calculates for response body init inputs of type string.
throwError(error: Error): MockScope
Mock a request with a defined error that will be thrown
when global fetch
is called.