MCPcopy Index your code
hub / github.com/nodejs/node / restart

Function restart

test/sequential/test-watch-mode.mjs:19–24  ·  view source on GitHub ↗
(file, content = readFileSync(file))

Source from the content-addressed store, hash-verified

17const supportsRecursive = common.isMacOS || common.isWindows;
18
19function restart(file, content = readFileSync(file)) {
20 // To avoid flakiness, we save the file repeatedly until test is done
21 writeFileSync(file, content);
22 const timer = setInterval(() => writeFileSync(file, content), common.platformTimeout(2500));
23 return () => clearInterval(timer);
24}
25
26function changeDetected(file) {
27 return `Change detected in ${inspect(file)}`;

Callers 3

runWriteSucceedFunction · 0.70
failWriteSucceedFunction · 0.70

Calls 9

writeFileSyncFunction · 0.85
clearIntervalFunction · 0.85
killMethod · 0.80
rejectMethod · 0.80
runFunction · 0.70
readFileSyncFunction · 0.50
setIntervalFunction · 0.50
setTimeoutFunction · 0.50
clearTimeoutFunction · 0.50

Tested by

no test coverage detected