Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


sandbox.useFakeTimers does not work #30

simao opened this Issue · 8 comments

4 participants



I am trying to run the code on this gist

I found this code on the Sinon.JS documention but it doesn't work, all the tests fail. I tried it on the latest versions of Firefox and Chome both on Windows and Mac OS X.

Any ideas?



After reading some of the SinonJS, Qunit and jQuery code I managed to find out that jQuery is using window.webkitRequestAnimationFrame or window.mozRequestAnimationFrame instead of setInterval.


This shows that if you set window.mozRequestAnimationFrame to false before loading jQuery, it will use setTimeout and SinonJS will work properly.


Thanks for figuring out this. I guess the site should give a different example that will actually work...


It looks like the RAF support is going to be removed from jQuery for now, which would probably get rid of this issue as well. Nonetheless would be good to also solve this in Sinon.JS for backwards compability.

Btw. both and take forever to load, if they load at all.


Sorry about the sites... I've been having some trouble with my VPS, but haven't been able to debug it yet :(


Closing this issue as it is not a bug in the timing code.

@cjohansen cjohansen closed this

Was thinking it might be worth updating the documentation to cover this case.


@woodlouse81 I agree. A pull request for would be most welcome ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.