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

Function waitForText

test/sequential/test-watch-mode.mjs:834–845  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

832 }
833
834 async function waitForText(text) {
835 const seenPromise = new Promise((resolve) => {
836 const fn = (data) => {
837 if (data.toString().includes(text)) {
838 resolve();
839 child.stdout.off('data', fn);
840 }
841 };
842 child.stdout.on('data', fn);
843 });
844 await seenPromise;
845 }
846
847 await waitForText('running');
848 await waitForEcho('first message');

Callers 1

Calls 1

onMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…