-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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.useFakeTimers in acceptance tests break if run.later is used #14722
Comments
I think the issue is in Backburner. |
I think the problem is that sinon.useFakeTimers() is modifying the environment (the timers of the VM JS, as kind-of-everything depends on setTimeout). You can put a lot of
|
p.s.2: I've fixed your twiddle, taking out the 'Date' parameter in |
believe this has been addressed: BackburnerJS/backburner.js#179 (although that was merged yesterday) and it still needs to make its way into ember. |
@morhook Not putting a Date in sinon.useFakeTimers() kind of defeats the point, the use case is so that Date.now() returns a predictable value, allowing acceptance tests that use the Date to pass regardless of what date it is. |
@stefanpenner so does this need a PR for the Backburner update? |
@pixelhandler I'd be happy to make a follow-up PR in Ember if necessary. |
@Gaurav0 sounds fair! Thanks for explaining it to me. |
Discussed with @Turbo87 and we believe this is resolved. |
yes, https://github.com/BackburnerJS/backburner.js/pull/179/files resolved it and has found its way into one of the recent Ember releases, though I can't say which one specifically fixed it. |
Just fyi for anyone running into this problem, it looks like the Backburner fix is not included in Ember 2.14. It looks like it is shipping in 2.15. |
You can use sinon.useFakeTimers in an acceptance test, or you can use run.later in your application, but doing both causes the acceptance test to time out.
Reproduction: https://ember-twiddle.com/d5f34d97be1e75b8258e654f6a482d70?openFiles=tests.acceptance.my-acceptance-test.js%2C
The text was updated successfully, but these errors were encountered: