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
While executing tests in one of my private repositories, I've seen a weird behaviour which differs from the expected behaviour of native fetch.
When executing the fetch function with an already aborted signal, normalizeRequest (https://github.com/jefflau/jest-fetch-mock/blob/master/src/index.js#L123-L142) throws a DOMException. However, since this function is synchronous, the Error bubbles up without having the chance to intercept its failure with a rejected Promise as it happens with the native implementation. As you can imagine, the result is failing tests.
I'm wondering: is it intended behaviour?
Here, you can find a repo with the reproduction step of what I intend. I've put both the expected and unexpected behaviours.
I am available to help you. 😄
The text was updated successfully, but these errors were encountered:
Hi all!
While executing tests in one of my private repositories, I've seen a weird behaviour which differs from the expected behaviour of native fetch.
When executing the
fetch
function with an already aborted signal,normalizeRequest
(https://github.com/jefflau/jest-fetch-mock/blob/master/src/index.js#L123-L142) throws aDOMException
. However, since this function is synchronous, the Error bubbles up without having the chance to intercept its failure with a rejectedPromise
as it happens with the native implementation. As you can imagine, the result is failing tests.I'm wondering: is it intended behaviour?
Here, you can find a repo with the reproduction step of what I intend. I've put both the expected and unexpected behaviours.
I am available to help you. 😄
The text was updated successfully, but these errors were encountered: