(text)
| 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'); |
no test coverage detected
searching dependent graphs…