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

sandbox.useFakeTimers does not work #30

Closed
simao opened this issue Jul 29, 2011 · 8 comments
Closed

sandbox.useFakeTimers does not work #30

simao opened this issue Jul 29, 2011 · 8 comments

Comments

@simao
Copy link

simao commented Jul 29, 2011

Hello,

I am trying to run the code on this gist https://gist.github.com/1114658

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?

Thanks

@simao
Copy link
Author

simao commented Jul 30, 2011

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.

@simao
Copy link
Author

simao commented Jul 31, 2011

This http://jsfiddle.net/VCMAc/ shows that if you set window.mozRequestAnimationFrame to false before loading jQuery, it will use setTimeout and SinonJS will work properly.

@cjohansen
Copy link
Contributor

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

@jzaefferer
Copy link

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 sinonjs.org and http://cjohansen.no/sinon/ take forever to load, if they load at all.

@cjohansen
Copy link
Contributor

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

@cjohansen
Copy link
Contributor

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

@colin-jack
Copy link

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

@cjohansen
Copy link
Contributor

@woodlouse81 I agree. A pull request for https://github.com/cjohansen/sinon-web would be most welcome ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants