Skip to content
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

Add countTimers method #215

Merged
merged 4 commits into from
Oct 8, 2018
Merged

Add countTimers method #215

merged 4 commits into from
Oct 8, 2018

Conversation

thejohnfreeman
Copy link
Contributor

Fixes #163 and #213 by adding a method to count the waiting timers. I (and I believe others: Facebook, @radarfox, @SimenB, ?) want this method to check for "timer leaks" in our tests.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it 🙂

FWIW, if we document clock.timers I'm fine with that as a solution, as the helper added in this PR would then be trivial to implement in user-land

@radarfox
Copy link

radarfox commented Oct 8, 2018

Don't forget, that the clock.timers are not initialized for some reason, so the triviality is questionable, as you have to remember to do the empty check every time.

@fatso83 fatso83 merged commit 00f3a5f into sinonjs:master Oct 8, 2018
@fatso83
Copy link
Contributor

fatso83 commented Oct 8, 2018

Thanks for the work. Released as part of lolex 3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants