-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Provide more context on infinite recursion in jest.runAllTimers #2893
Comments
I like the idea. Would you be willing to send a PR with the implementation? |
I am willing to look into it, if this is still relevant. Is it? :) |
Yup, up for grabs! |
It would make more sense to provide this to Lolex as we will (at least most likely) migrate to it (see #5171). If you really want to, go ahead of course, it'll be useful either way :) |
I've opened up sinonjs/fake-timers#230 |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
If you have an infinite loop of timers and run
jest.runAllTimers()
, you get the following error:This doesn't really give me any context as to where these timers are. It's fine if the mistake was running
jest.runAllTimers()
but not if the mistake was having an infinite loop of timers.What is the expected behavior?
What I would like to see is an error message that looks like the following:
i.e. for each pending timer, show what created the timer, and the stack trace at the time the tiemrs were created. This shouldn't affect existing performance too badly because the stack traces would only need to be gathered on the final run whenw e know we're about to report the infinite loop. Because we've already run it 1000 times, any legitimate timers should also already have finished running, which is convenient.
The text was updated successfully, but these errors were encountered: