(stream: NodeJS.ReadableStream)
| 157 | }); |
| 158 | |
| 159 | async function drainStream(stream: NodeJS.ReadableStream): Promise<string> { |
| 160 | const chunks: Buffer[] = []; |
| 161 | return new Promise((resolveStream, rejectStream) => { |
| 162 | stream.on("data", (chunk) => chunks.push(Buffer.from(chunk))); |
| 163 | stream.on("end", () => resolveStream(Buffer.concat(chunks).toString("utf8"))); |
| 164 | stream.on("error", rejectStream); |
| 165 | }); |
| 166 | } |
| 167 | |
| 168 | async function waitForExit(proc: ChildProcess): Promise<void> { |
| 169 | if (proc.exitCode !== null) return; |
no test coverage detected