You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test('should be provided to fetch API in getJSON function',async()=>{server.respondWith(request=>{request.respond(200,{'Content-Type': 'application/json'},'{"foo": "bar"}');});// this basically does a fetch request with cache as one of the optionsconstpromise=getJSON({url: 'http://example.com/test-params.json',cache: 'force-cache',headers: {'Authorization': 'Bearer 123'}},newAbortController());server.respond();awaitpromise;expect(server.requests.length).toBe(1);expect(server.requests[0].url).toBe('http://example.com/test-params.json');expect(server.requests[0].method).toBe('GET');console.log(server.requests[0]["cache"]);expect(server.requests[0]["cache"]).toBe('force-cache');// I can't find cache in the request object...?expect(server.requests[0].requestHeaders["Authorization"]).toBe('Bearer 123');});
Any help would be appreciated :-)
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The following is a request parameter that we are using:
https://developer.mozilla.org/en-US/docs/Web/API/Request/cache
But I'm unable to see it in the tests, here's my simple test:
Any help would be appreciated :-)
The text was updated successfully, but these errors were encountered: