(port, cb)
| 59 | const timeout = setTimeout(() => cleanUp('Timed out'), 5000); |
| 60 | |
| 61 | function waitForPort(port, cb) { |
| 62 | const socket = net.connect(common.PORT, () => { |
| 63 | socket.on('data', () => {}); |
| 64 | socket.end(); |
| 65 | socket.on('end', cb); |
| 66 | }); |
| 67 | socket.on('error', (e) => { |
| 68 | if (e.code === 'ENOENT' || e.code === 'ECONNREFUSED') { |
| 69 | setTimeout(() => waitForPort(port, cb), 1000); |
| 70 | } else { |
| 71 | cb(e); |
| 72 | } |
| 73 | }); |
| 74 | } |
| 75 | |
| 76 | waitForPort(common.PORT, common.mustCall((err) => { |
| 77 | if (err) { |
no test coverage detected
searching dependent graphs…