Version
22
Platform
Subsystem
test_runner
What steps will reproduce the bug?
I think test below should succeed, but it didn't.
test('clearInterval', (t) => {
t.mock.timers.enable();
const res = [];
const id = setInterval(()=>{
res.push('1')
clearInterval(id);
},10);
t.mock.timers.tick(10);
t.mock.timers.tick(10);
t.mock.timers.tick(10);
assert.strictEqual(res.length, 1); // fails with logs: 3 !==1
});
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
test succeed
What do you see instead?
test failed
Additional information
No response