-
Notifications
You must be signed in to change notification settings - Fork 3.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
Expose setSystemTime from lolex #15424
Comments
|
P.S: I have a working test right now as I just used the workaround of installing the underlying package myself and manually faking timers, and then using setSystemTime, but would of course be neat to not have to do that |
|
Hi @jennifer-shehane so I see it was tagged as a proposal, thank you for that! I was just wondering what this means logistically. Is it welcome for me to contribute this change or does it need to go through some kind of discussion first? |
|
@emilgoldsmith I think this would be an accepted change. There seems to be a use case for it. Maybe @chrisbreiding has some thoughts. |
|
That sounds good to me 👍 |
|
Great :), I’ll try to set aside time for it one weekend then, but anyone else following is definitely welcome to do it too :) |
|
The code for this is done in cypress-io/cypress#23329, but has yet to be released. |
|
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
What would you like?
I would like to be able to do:
Why is this needed?
I am testing a timer, and I realized that when I wanted to test it also displays hours correctly, I did cy.tick(46060*1000) and Cypress froze because it was running thousands of setInterval callbacks in a row.
setSystemTimeallows me to skip forward in time, and I can still use tick for small increment testing.I'm happy to do the implementing
The text was updated successfully, but these errors were encountered: