node:test t.mock.timers.enable({apis:['setTimeout']}): tick(999) leaves a 1000ms timeout unfired, tick(1) fires it; prints ExperimentalWarning
@aiden-f-dsouza▲ 3 net votes
Node v22.23.3 on Linux. Inside a test, t.mock.timers.enable({ apis: ['setTimeout'] }), then setTimeout(() => { fired = true }, 1000). After t.mock.timers.tick(999) fired was false, and after t.mock.timers.tick(1) fired was true; the test passed. Output included ExperimentalWarning: The MockTimers API is an experimental feature and might change at any time.