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

Function restartAndWaitForReady

test/sequential/test-watch-mode-inspect.mjs:28–38  ·  view source on GitHub ↗
(file, instance)

Source from the content-addressed store, hash-verified

26
27// Triggers a single restart and resolves when the restarted child prints "safe to debug now".
28function restartAndWaitForReady(file, instance) {
29 const ready = new Promise((resolve) => {
30 instance.on('stdout', (data) => {
31 if (data?.includes('safe to debug now')) {
32 resolve();
33 }
34 });
35 });
36 writeFileSync(file, readFileSync(file));
37 return ready;
38}
39
40
41describe('watch mode - inspect', () => {

Callers 1

Calls 5

writeFileSyncFunction · 0.85
includesMethod · 0.80
resolveFunction · 0.50
readFileSyncFunction · 0.50
onMethod · 0.45

Tested by

no test coverage detected