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

Fix onerror event triggering for fake xhr requests #1041

Merged
merged 2 commits into from
May 5, 2016

Conversation

fearphage
Copy link
Member

Purpose (TL;DR) - mandatory

The xhr.onerror event was not firing at all.

Background (Problem in detail) - optional

I cam across this issue while looking into #1040 and #1031. There are a finite number of xhr.on__event__ hooks that sinon was checking and onerror was not on the list.

Note: There is talk of errors being triggered at the wrong time in sinon. I did not address that at all. This only makes xhr.onerror trigger when an error event is triggered. I added additional tests to ensure the order and make sure this stays functional in the future.

Solution

Added error event to sequence of events looked for on xhr object (xhr['on' + name]).

How to verify - mandatory

  1. Check out this branch (see github instructions below)
  2. npm install
  3. npm test

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.

2 participants