Skip to content
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

Getting an error of XMLHttpRequest while running jest test case #933

Open
ArjunPatidarRadix opened this issue Mar 21, 2024 · 6 comments
Open
Labels

Comments

@ArjunPatidarRadix
Copy link

ReferenceError: XMLHttpRequest is not defined

Screenshot 2024-03-21 at 11 07 31 AM

i have also searched on web to mock this package for jest test cases but didn't find any proper steps or doc about it
so if anyone have info about mocking then please guide me for same.

@ArjunPatidarRadix ArjunPatidarRadix changed the title getting an error of XMLHttpRequest while running jest test case Getting an error of XMLHttpRequest while running jest test case Mar 21, 2024
@MarcHbb
Copy link

MarcHbb commented Apr 13, 2024

Have the same issue

@ArjunPatidarRadix
Copy link
Author

ArjunPatidarRadix commented May 3, 2024

have you found any solution for it? @MarcHbb

@Hosam-hsm
Copy link

Any updates on this issue?

@naveedashfaq272
Copy link

Facing the same problem... any solution ??

@edapess
Copy link

edapess commented Oct 9, 2024

Guys any updates on this? I just mocked GooglePlacesAutocomplete component but it's not what I wanted to do

@arquilca
Copy link

Try using xhr-mock. Look at the example they provide - you'll have to do setup(), teardown(), and a mock of the http method you want to mock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants