-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Closed
Description
Version
22
Platform
mac m1
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
Metadata
Metadata
Assignees
Labels
No labels