-
Notifications
You must be signed in to change notification settings - Fork 158
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
support FakeXMLHttpRequest response property #280
Conversation
package.json
Outdated
@@ -48,7 +48,7 @@ | |||
"typescript-eslint-parser": "^21.0.2" | |||
}, | |||
"dependencies": { | |||
"fake-xml-http-request": "^2.0.0", | |||
"fake-xml-http-request": "kellyselden/FakeXMLHttpRequest#response", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this package used in test is from bower.
https:/pretenderjs/pretender/blob/v3.0.4/karma.conf.js#L18
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just merged #281. Can you try rebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's github artifact cache didn't update. I just tried v2.1.1 and it passed tests.
a0d00cc
to
cc501bc
Compare
Do you happen to see where I went wrong in the tests or code? |
@kellyselden It seems the changes in Line 18 in 0b04362
|
cc501bc
to
851d639
Compare
@xg-wang Good call. I did that, and it appears the same issue remains. |
851d639
to
a3cda96
Compare
Updated with 2.1.1 and all is good now. |
fake-xml-http-request v2.1.1 introduced breaking changes to the handling of the `response` property. In previous releases, `response` was not always present, allowing fake-xml-http-response to interact with libraries such as [whatwg-fetch](https:/github/fetch/blob/96b37eb63ef8f2644f985cd77e7bd87b04e61ad4/fetch.js#L462) that make decisions based on that behavior. Because pretender has a caret dep on fake-xml-http-request, that change effectively broke the previous major release (v2.x) of pretender because the PR pretenderjs#280 is only available on the current major release (v3.x). This PR simply changes the dependency on fake-xml-http-request from a caret `^` to a tilde `~` in order to prevent that breaking change from leaking through. If merged to a branch split from the last v2 commit and released as v2.1.2, it would restore the previous behavior without having any effect on the current major release.
re pretenderjs/FakeXMLHttpRequest#53
These 2 PRs fixed the problem for me ember-vr/ember-vr-shopping#192