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
On Node.js there is no window object! It exists only in browsers. When you want to use XMLHttpRequest in Node.js you have to import it at first like this:
import{XMLHttpRequest}from'xmlhttprequest'
And that's the reason why the implementation is not replaced. Do you have any idea how to fix it? Thank you very much!
The text was updated successfully, but these errors were encountered:
Hello,
thanks for creating this awesome package. I like it very much but I am not able to use it on Node.js.
I've tried to use it but it looks like the original implementation of
XMLHttpRequest
is not replaced with the mocked one.I've made a little investigation about this problem and I've figured out that the problem is in
setup
function inXHRMock
class:On Node.js there is no
window
object! It exists only in browsers. When you want to useXMLHttpRequest
in Node.js you have to import it at first like this:And that's the reason why the implementation is not replaced. Do you have any idea how to fix it? Thank you very much!
The text was updated successfully, but these errors were encountered: