Asynchronous test scripts failing with Network Error intermittently #1078
Unanswered
SaranyaSKumar226
asked this question in
Q&A
Replies: 2 comments
-
@SaranyaSKumar226 did you end up figuring this out? Edit: NVM, figured it out. in my case it was an unrelated test doing a network call that ended up failing during a subsequent test, failing that subsequent test. Jest being on silent mode hid the root cause. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm getting the same error :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I upgraded the user-event library toV14.4.3 and made all user action related tests as asynchronous by adding the async and await. The tests are running successfully individually. But if I run all test suits together then it is throwing "Network Error" intermittently for some test script as below. I am not making any axios call in the related area.
Network Error
at createError (node_modules/axios/lib/core/createError.js:16:15)
at XMLHttpRequest.handleError (node_modules/axios/lib/adapters/xhr.js:99:14)
at XMLHttpRequest.invokeTheCallbackFunction (node_modules/jsdom/lib/jsdom/living/generated/EventHandlerNonNull.js:18:28)
at XMLHttpRequest. (node_modules/jsdom/lib/jsdom/living/helpers/create-event-accessor.js:35:32)
at innerInvokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:338:25)
at invokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:274:3)
at XMLHttpRequestImpl._dispatch (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:221:9)
at fireAnEvent (node_modules/jsdom/lib/jsdom/living/helpers/events.js:18:36)
at requestErrorSteps (node_modules/jsdom/lib/jsdom/living/xhr/xhr-utils.js:131:3)
at Object.dispatchError (node_modules/jsdom/lib/jsdom/living/xhr/xhr-utils.js:60:3)
at Request. (node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:655:18)
at ClientRequest. (node_modules/jsdom/lib/jsdom/living/helpers/http-request.js:121:14)
My config is :
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
Anyone please help me to resolve this issue.
Beta Was this translation helpful? Give feedback.
All reactions