1'use strict'; 2const common = require('../common'); 3common.skipIfInspectorDisabled(); 4 5const assert = require('assert'); 6const { NodeInstance } = require('../common/inspector-helper.js'); 7 8async function runTests() { 9 const instance = new NodeInstance(undefined, 'console.log(10)'); 10 const session = await instance.connectInspectorSession(); 11 await session.send([ 12 { 'method': 'Runtime.enable' }, 13 { 'method': 'Debugger.enable' }, 14 { 'method': 'Runtime.runIfWaitingForDebugger' }, 15 ]); 16 await session.waitForBreakOnLine(0, '[eval]'); 17 await session.runToCompletion(); 18 assert.strictEqual((await instance.expectShutdown()).exitCode, 0); 19} 20 21runTests().then(common.mustCall()); 22