-
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
Fix readystatechange #130
Fix readystatechange #130
Conversation
…orting `onload`, for ajax implementations that still rely on readystatechange - Move `evts` into function closure so multiple calls to `createPassthrough` don't result in duplicate entries in `evts`.
503a111
to
512d696
Compare
If this is to fix issues with jQuery 1.x, the test suite needs to be updated to run integration tests against both jQuery 1.x and 2.x or we'll have regressions. |
This is to fix issues with any ajax client that uses the The additions to passthrough_test.js are designed to stop regressions of this case. |
@@ -201,7 +202,6 @@ function interceptor(pretender) { | |||
createUploadHandler(uploadEvents[i]); | |||
} | |||
|
|||
xhr.open(fakeXHR.method, fakeXHR.url, fakeXHR.async, fakeXHR.username, fakeXHR.password); |
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.
why was it necessary to move where the xhr.open is being called?
Good point, I probably should have explained this. There's a bug (https://bugs.webkit.org/show_bug.cgi?id=45994#c2) in older versions of webkit (that effect phantomjs 1.x) where the status is not accessible on an The downside is that the passthrough request doesn't proxy the initial Also, for neatness - I should really have moved it to below the
Also, on retrospect, I agree - will take a look at adding tests for jQuery 1 and 2 at some point this weekend. |
Looks good! |
Unfortunately there's a bug in pretender.js library, which makes AJAX requests fail within testrunners. pretenderjs/pretender#130
Unfortunately there's a bug in pretender.js library, which makes AJAX requests fail within testrunners. Please refer to: pretenderjs/pretender#130
The app this is based on originally used an older Mirage. The npm dependencies were updated to the newer, but not the bower. It was hoped this would fix the issue by incorporating the fix for pretenderjs/pretender#85 via pretenderjs/pretender#130 as part of the move past Pretender version 0.11.0 (https://github.com/pretenderjs/pretender/blob/master/CHANGELOG.md#0110), but, surprisingly, that did *not* fix the issue. Well, this is frustrating.
readystatechange
to xhr events regardless of the browser supportingonload
, for ajax implementations that still rely on readystatechange (eg jQuery 1.x jQuery 1.x with passthrough #85 )evts
into function closure so multiple calls tocreatePassthrough
don't result in duplicate entries inevts
.