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

Function failWriteSucceed

test/sequential/test-watch-mode.mjs:155–173  ·  view source on GitHub ↗
({ file, watchedFile })

Source from the content-addressed store, hash-verified

153}
154
155async function failWriteSucceed({ file, watchedFile }) {
156 const child = spawn(execPath, ['--watch', '--no-warnings', file], { encoding: 'utf8', stdio: 'pipe' });
157 let cancelRestarts = () => {};
158
159 try {
160 // Break the chunks into lines
161 for await (const data of createInterface({ input: child.stdout })) {
162 if (data.startsWith('Completed running')) {
163 break;
164 }
165 if (data.startsWith('Failed running')) {
166 cancelRestarts = restart(watchedFile, 'console.log("test has ran");');
167 }
168 }
169 } finally {
170 child.kill();
171 cancelRestarts();
172 }
173}
174
175tmpdir.refresh();
176

Callers 1

Calls 5

killMethod · 0.80
restartFunction · 0.70
cancelRestartsFunction · 0.70
spawnFunction · 0.50
createInterfaceFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…