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

Include ticks in countTimers #238

Closed
SimenB opened this issue Apr 21, 2019 · 1 comment · Fixed by #241
Closed

Include ticks in countTimers #238

SimenB opened this issue Apr 21, 2019 · 1 comment · Fixed by #241

Comments

@SimenB
Copy link
Member

SimenB commented Apr 21, 2019

We understand you have a problem and are in a hurry, but please provide us with some info to make it much more likely for your issue to be understood, worked on and resolved quickly.

  • Lolex version : 4.0.1
  • Environment : Node 10
  • Example URL : N/A
  • Other libraries you are using: N/A

What did you expect to happen?
See jestjs/jest#8139 for justification. Tl;dr; is that a timer count should include all scheduled timers and friends, not just timers.

What actually happens

clock.nextTick does not contribute to the count

How to reproduce

const lolex = require("lolex");

const clock = lolex.createClock();

clock.setTimeout(() => {}, 5);
clock.nextTick(() => {});

console.log(clock.countTimers()); // 1
@benjamingr
Copy link
Member

Sounds reasonable to me and easy to fix

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 a pull request may close this issue.

2 participants