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
This change uses fetch-mock's 'done' inspection to ensure that it matches the requests as expected to avoid tests passing for the wrong reason (i.e. we didn't mock a response).
I think I've found a bug in fetch-mock where it doesn't recognise that it matched a request when testing a query string independently of the URL. It works as expected when only partially matching the URL.
Refs #976, 047d979, https://www.wheresrhys.co.uk/fetch-mock/#api-inspectiondone, wheresrhys/fetch-mock#657
This is due to the unintuitive, and quite confusing implementation of filtering calls in fetch-mock. I'm working on a new library, @fetch-mock/core, which massively simplifies this, so will not be fixing this bug in fetch-mock
I have a sandbox with a single
getOnce
matcher like:When a request to
https://example.com/some-page/?foo=bar
is made it matches successfully.However,
fetch.done()
returnsfalse
.I've been able to work around this by changing the matcher to:
fetch.done()
then returnstrue
as expected.The text was updated successfully, but these errors were encountered: