(cp, requiredOutput)
| 215 | let childProcess; |
| 216 | |
| 217 | function waitForStartup(cp, requiredOutput) { |
| 218 | return new Promise((resolve, reject) => { |
| 219 | const aggregated = []; |
| 220 | cp.stdout.on('data', data => { |
| 221 | aggregated.push(data.toString()); |
| 222 | if (requiredOutput.every(r => aggregated.some(a => a.includes(r)))) { |
| 223 | resolve(); |
| 224 | } |
| 225 | }); |
| 226 | cp.on('error', reject); |
| 227 | }); |
| 228 | } |
| 229 | |
| 230 | afterEach(done => { |
| 231 | if (childProcess) { |
no test coverage detected