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

Latest version 2.9.26 cause mocha tests that use sinon.useFakeTimers to fail #631

demetriusnunes opened this issue May 26, 2015 · 3 comments


Copy link

My test suite uses sinon.useFakeTimers in some tests.

After the latest version bump to 2.9.26, all tests using sinon.useFakeTimers fail. Reverting back to 2.9.25 fixes the problem.

Copy link

Do you have some repro code? The last patch had nothing to do with timers

Copy link

It's probably 23d1b87, that changed the binding time of setImmediate which is one of the methods that sinon fakes. If you are loading sinon after Bluebird you're getting sinon's fake method now. I'm not sure setImmediate should be faked because it's more of a low-level task scheduler. See sinonjs/sinon#527 for some ways to deal with it.

Copy link

@dmethvin I guess so, their documentation says nothing about setImmediate :(

dmethvin referenced this issue in jquery/jquery Jun 17, 2015
Using modules for window.setTimeout etc. made those functions cached and
disabled Sinon mocking, making effects tests fail. Just writing
window.setTimeout directly is smaller anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

3 participants