module@warp-drive/holodeck/mock
Function HEAD()
ts
function HEAD(
owner: object,
url: string,
response: ResponseGenerator,
options?: Partial<Omit<Scaffold, "response" | "url" | "method">> & {
RECORD?: boolean;
}
): Promise<void>;Defined in: mock.ts:326
Sets up Mocking for a HEAD request on the mock server for the supplied url.
The response body is generated by the supplied response function.
Available options:
- status: the status code to return (default: 200)
- headers: the headers to return (default: {})
- body: the body to match against for the request (default: null)
- RECORD: record this request even when the suite is replaying, such as under CI (default: false). A local override for re-recording one request. Do not commit it; a committed RECORD means that request is never replayed against its fixture.
Parameters
owner
object
url
string
the url to mock, relative to the mock server host (e.g. users/1)
response
a function which generates the response to return
options?
Partial<Omit<Scaffold, "response" | "url" | "method">> & { RECORD?: boolean; }
status, headers for the response, body to match against for the request, and whether to force recording
Returns
Promise<void>