(repl, command, gate, calls)
| 57 | } |
| 58 | |
| 59 | async function assertCommandWaitsForInit(repl, command, gate, calls) { |
| 60 | let settled = false; |
| 61 | const promise = evalCommand(repl, command).then(() => { |
| 62 | settled = true; |
| 63 | }); |
| 64 | |
| 65 | await new Promise(setImmediate); |
| 66 | assert.strictEqual( |
| 67 | settled, |
| 68 | false, |
| 69 | `${command} resolved before post-connect initialization completed: ${calls}`, |
| 70 | ); |
| 71 | |
| 72 | gate.resolve(); |
| 73 | await promise; |
| 74 | assert.strictEqual(settled, true); |
| 75 | } |
| 76 | |
| 77 | (async () => { |
| 78 | const calls = []; |
no test coverage detected
searching dependent graphs…