()
| 9 | // connections without waiting for the client to disconnect. |
| 10 | |
| 11 | async function test() { |
| 12 | const script = ` |
| 13 | const inspector = require('inspector'); |
| 14 | inspector.close(); |
| 15 | process.exit(42); |
| 16 | `; |
| 17 | |
| 18 | const instance = new NodeInstance(['--inspect-brk=0'], script); |
| 19 | const session = await instance.connectInspectorSession(); |
| 20 | |
| 21 | // Enable Runtime domain and wait for an event to confirm the session is live. |
| 22 | await session.send({ method: 'Runtime.enable' }); |
| 23 | await session.waitForNotification('Runtime.executionContextCreated'); |
| 24 | |
| 25 | // Resume execution so the script calls inspector.close(). |
| 26 | await session.send({ method: 'Runtime.runIfWaitingForDebugger' }); |
| 27 | |
| 28 | // The server should forcibly disconnect us. |
| 29 | await session.waitForServerDisconnect(); |
| 30 | |
| 31 | const { exitCode } = await instance.expectShutdown(); |
| 32 | assert.strictEqual(exitCode, 42); |
| 33 | } |
| 34 | |
| 35 | test().then(common.mustCall()); |
no test coverage detected
searching dependent graphs…