Timecop is freezing tests
See original GitHub issueWe are using https://github.com/matteodepalo/ember-cli-timecop in a few component integration tests and until now this worked fine. We tried to convert those tests to use the new testing APIs, but now Timecop.freeze()
seems to block the async render(...)
call from continuing.
An issue similar to this has existed in the past where Backburner.js would not continue running when Date.now()
is mocked and frozen, but was fixed by getting a reference to the Date
object on startup and then using that reference instead of the temporary mocked global.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (12 by maintainers)
Top Results From Across the Web
travisjeffery/timecop - GitHub
A gem providing "time travel" and "time freezing" capabilities, making it dead simple to test time-dependent code. It provides a unified method to...
Read more >Timecop vs Rails TimeHelpers - Grinding Gears - FreeAgent
This flakiness can be eliminated by including Timecop and calling Timecop.freeze at the beginning of this test. This will cause the current ...
Read more >Timecop: Freeze Time in Ruby Development for Better Testing
How to improve your rails development by freezing time for better testing.
Read more >Change time like Time Cop while testing in Ruby on Rails
Freeze time or travel back or future in time while testing Ruby on Rails application easily using Time Cop gem.
Read more >Stubbing Time in Capybara Specs | Geoff Harcourt
Timecop is only able to affect the time in Ruby-land on the server, so using Timecop in a system spec will lead to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@rwjblue https://github.com/Turbo87/__timecop-issue
If you have the time, could you put together a repo I could use for testing / experimenting with this?