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

Prevent InvalidAccessError when using a synchronous XHR in browser #67

Merged
merged 2 commits into from
Oct 14, 2018

Conversation

sebcanonica
Copy link
Contributor

@sebcanonica sebcanonica commented Oct 8, 2018

Changing the responseType only when necessary, as setting it too liberally can cause an exception, like when using a synchronous request in a browser context.
Issue #61

@fatso83
Copy link
Contributor

fatso83 commented Oct 9, 2018

If this is supposed to fix an existing issue, could you add a test to lib/fake-xhr/index.test.js called something like describe("issue 61 - InvalidAccessError on synchronous XHR in browser", ...) that throws when your fix is not added? I am guessing you have a test case in #61 already.

@sebcanonica
Copy link
Contributor Author

Ok, I have added a mockist test for this issue.
Do you have a way to execute the test suite in a browser?
I tried with mochify like in sinon main repo, but the suite keep getting stuck randomly.
When run in a browser, the disabled test "loads resource synchronously" fails even before the asserts because of the original problem.

@fatso83
Copy link
Contributor

fatso83 commented Oct 10, 2018

Thank you for that! We should definitively have a mockito suite running Chrome headless, like in the other sibling projects. We'll look into it.

@fatso83
Copy link
Contributor

fatso83 commented Oct 14, 2018

Based on the remarks from #69 I expect this to pass, even though it's hasn't run with the new mockito script on Travis.

Thanks a lot!

@fatso83 fatso83 merged commit 492703d into sinonjs:master Oct 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants