Skip to content

Instantly share code, notes, and snippets.

@gregblake
Created March 4, 2021 20:07
Show Gist options
  • Save gregblake/bfbce67d7c14efd150ad64b7ea944893 to your computer and use it in GitHub Desktop.
Save gregblake/bfbce67d7c14efd150ad64b7ea944893 to your computer and use it in GitHub Desktop.
Error when running jest on ContentRow.spec.js: XMLHttpRequest is not defined
$ jest /Users/greg/code/connect-rn/__tests__/components/Events/ContentRow.spec.js
FAIL __tests__/components/Events/ContentRow.spec.js
● Test suite failed to run
ReferenceError: XMLHttpRequest is not defined
56 | }
57 |
> 58 | let hasonprogress = new XMLHttpRequest().onprogress === null
| ^
59 | let allowChunked = function() {
60 | return me.enableChunkedEncoding && hasonprogress
61 | }
at app/utils/message-bus.js:58:23
at Object.<anonymous> (app/utils/message-bus.js:6:2)
at Object.<anonymous> (app/hooks/index.ts:5:1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment