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

Expose readyState constants on XHR instances #1173

Merged
merged 1 commit into from
Nov 1, 2016
Merged

Expose readyState constants on XHR instances #1173

merged 1 commit into from
Nov 1, 2016

Conversation

dottedmag
Copy link

Purpose (TL;DR) - mandatory

Expose readyState constants on XHR instances to allow mocking code which uses them.

Background (Problem in detail) - optional

  • Browsers implement readyState constants on XHR instances.
  • XHR spec says to do so too: https://xhr.spec.whatwg.org/#states
  • There is code which uses it and it breaks under Sinon's XHR mock.

How to verify - mandatory

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

According to https://xhr.spec.whatwg.org/#states
readyState constants should be exposed by XHR instances,
and checking browsers' behaviour confirms it.
@coveralls
Copy link

coveralls commented Oct 24, 2016

Coverage Status

Coverage increased (+0.003%) to 96.376% when pulling 699c6dd on dottedmag:expose-constants into 4ff653d on sinonjs:master.

@fatso83 fatso83 merged commit 4c2150e into sinonjs:master Nov 1, 2016
@fatso83
Copy link
Contributor

fatso83 commented Nov 1, 2016

Big up! Nice and clear.

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

3 participants