Optionalinit: RequestInitOptionalinit: RequestInitimport {createMockEndpointFetch, fetchEndpoint} from '@rest-vir/define-service';
fetchEndpoint(myService.endpoints['/my-path'], {
fetch: createMockEndpointFetch(myService.endpoints['/my-path'], {
body: 'some body',
// there are other properties that can be mocked as well, see the types for more details
}),
});
Creates a mock
fetchfunction that returns a mockResponseobject that matches the expectations of the given endpoint. For more genericfetchmocking, see createMockFetch.