New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mocking XMLHttpRequest on Node.js doesn't work #76
Comments
Thanks @tomasfabry! It's likely related to this issue #67 - You could try changing Would you be able to contribute some docs for using |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: