-
-
Notifications
You must be signed in to change notification settings - Fork 770
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
Sinon fake server not working in chrome 42 #727
Comments
I run chrome canary which is like 2 steps ahead for regular chrome. Everything works for me. |
Could you post some code that fails? Does it fail in other browsers? |
Hey guys, I'm having trouble getting the code working on old versions of Chrome now. Perhaps I was mistaken. I've boiled down the code to the following:
The above throws a 404. My tests are running in the browser via browserify, could this be complicating things? Any insight you can provide would be great. Thanks. |
+1, this times out:
|
@lukewilde, @hayesmaker how are you running the code examples? |
in a browser, using mocha |
this might be a more clear example of it not working:
chai.use(sinonChai); describe.only("Testing Sinon works cross browsers", function() {
}); |
While trying to boil down a simple set of replication steps it's actually tripping over because of our XHR request library fetch which must be doing something strange under the hood. |
That is interesting, I look forward to seeing a reduced test case |
@lukewilde window.fetch landed on Chrome stable as of 42, so sinon.fakeServer isn't going to serve you well. I've managed to work around it for the timebeing by forcing the shim, i.e. settings |
As @kruppel mentioned, the reason these issues arise is because Chrome has shipped a native fetch implementation that doesn't use XHR. I think the correct thing would be for Sinon to stub both XHR and native fetch. I don't think disabling the native implementation and forcing the use of the polyfill for testing is good practice. |
didn't help me, I still got 404 for code like
what else can be the problem? Chrome 56.0.2924.87 (64-bit) |
may be the solution is to not to test this functionality? |
This seems to be related to testing things that use I would recommend using one of these libraries for faking fetch: I am closing this, since it doesn't seem to be a problem with what IS provided by Sinon. Feel free to re-open this, if you feel that I am mistaken. Bonus points for a simple, runable test case that shows the defect. |
After updating Chrome to version 42 the fake server seems to be letting requests slip past it.
Instead of being intercepted and returning their mock data my requests throw 404's.
I've confirmed the issue effects Windows and OSX. Prior to Chrome version 42 both work correctly, and break immediately after updating.
The text was updated successfully, but these errors were encountered: