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

Function waitForEcho

test/sequential/test-watch-mode.mjs:820–832  ·  view source on GitHub ↗
(msg)

Source from the content-addressed store, hash-verified

818 child.stdout.on('data', (data) => stdout += data);
819 child.stderr.on('data', (data) => stderr += data);
820 async function waitForEcho(msg) {
821 const receivedPromise = new Promise((resolve) => {
822 const fn = (message) => {
823 if (message === msg) {
824 child.off('message', fn);
825 resolve();
826 }
827 };
828 child.on('message', fn);
829 });
830 child.send(msg);
831 await receivedPromise;
832 }
833
834 async function waitForText(text) {
835 const seenPromise = new Promise((resolve) => {

Callers 1

Calls 2

sendMethod · 0.65
onMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…