Files
Kmake/test/parallel/test-timers-refresh-in-callback.js

15 lines
321 B
JavaScript
Raw Permalink Normal View History

2026-05-26 23:36:42 -07:00
'use strict';
const common = require('../common');
// This test checks whether a refresh called inside the callback will keep
// the event loop alive to run the timer again.
let didCall = false;
const timer = setTimeout(common.mustCall(() => {
if (!didCall) {
didCall = true;
timer.refresh();
}
}, 2), 1);