1'use strict'; 2 3const common = require('../common'); 4 5// This test checks whether a refresh called inside the callback will keep 6// the event loop alive to run the timer again. 7 8let didCall = false; 9const timer = setTimeout(common.mustCall(() => { 10 if (!didCall) { 11 didCall = true; 12 timer.refresh(); 13 } 14}, 2), 1); 15