You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to find out how many timers is actively running, but I can't find any mention of it in the API reference.
My use case is that I'm writing a test for a destructor function and I would like to make sure that all timers got cancelled after the function execution so there would be no memory leaks.
Currently I'm using this hotfix Object.keys(clock.timers || {}).length, but it seems quite verbose and dependent on the inner implementation.
The text was updated successfully, but these errors were encountered:
.uninstall returns all the pending timers as an array. You can check its .length which is less hacky although I'm not sure we have this behavior documented.
Hello,
I would like to find out how many timers is actively running, but I can't find any mention of it in the API reference.
My use case is that I'm writing a test for a destructor function and I would like to make sure that all timers got cancelled after the function execution so there would be no memory leaks.
Currently I'm using this hotfix
Object.keys(clock.timers || {}).length
, but it seems quite verbose and dependent on the inner implementation.The text was updated successfully, but these errors were encountered: