-
Notifications
You must be signed in to change notification settings - Fork 45
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
FakeXMLHttpRequest falsly sets responseXML #25
Comments
When running tests in node using JSDom then I believe this is a deficiency in https://github.com/jindw/xmldom which appears to be a dead project. However, nise does not seem to check for parsererror tags, which would normally be returned in an error document by a browser (ref: https://developer.mozilla.org/en-US/docs/Web/API/DOMParser) - rather than an exception being thrown as nise seems to expect. It would seem sensible for nise to check for parsererror and return null if found here https://github.com/sinonjs/nise/blob/master/lib/fake-xhr/index.js#L319-L322 - which I believe would solve this issue when run in a browser. Eg:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Should have been fixed by #50. |
@mnahkies Want to check that this works as you think before we cut a new release? Clone, |
@fatso83 sorry I'm travelling for the next month or so with limited computer access. I had a glance over the pull request and it looked fine to me |
Migrated from sinonjs/sinon#1678
Originally created by @Ninerian on Fri, 26 Jan 2018 14:41:19 GMT
What did you expect to happen?
When a invalid xml file is loaded with XMLHttpRequest, the responseXML is null.
What actually happens
The FakeXMLHttpRequest fills the responseXML with the parsed xml document with included parseErrors.
How to reproduce
Solution
After parsing the response, you should check for parseerrors and return null.
The text was updated successfully, but these errors were encountered: