Creates a mock fetch function that always returns a mock Response object based on the given
response parameters. For more control over a mocked fetch, use createMockResponse
directly. See createMockEndpointFetch for a more type safe version, specific to individual
endpoints.
fetchEndpoint(myService.endpoints['/my-path'], { fetch:createMockFetch({ body:'some body', // there are other properties that can be mocked as well, see the types for more details }), });
Creates a mock
fetch
function that always returns a mockResponse
object based on the given response parameters. For more control over a mockedfetch
, use createMockResponse directly. See createMockEndpointFetch for a more type safe version, specific to individual endpoints.