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

sinon hack Date Object prevent throttle get passed #40

Open
chemzqm opened this issue Oct 22, 2015 · 2 comments
Open

sinon hack Date Object prevent throttle get passed #40

chemzqm opened this issue Oct 22, 2015 · 2 comments

Comments

@chemzqm
Copy link

chemzqm commented Oct 22, 2015

https://github.com/kolodny/exercises/blob/master/throttle/test.js#L8
makes method call Date.now() and (new Date()).getTime() always return 0
It works quite weird, IMO

@jcready
Copy link

jcready commented Oct 31, 2015

👍

And it's easy to fix. Simply pass Date.now() into that useFakeTimers() method.

@kolodny
Copy link
Owner

kolodny commented Feb 28, 2017

I'm playing around with https://github.com/kolodny/exercises/tree/fix-time-issues that should fix this issue

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

3 participants