1'use strict'; 2const common = require('../common'); 3 4// Regression test for https://github.com/nodejs/node/issues/32648 5 6common.skipIfInspectorDisabled(); 7 8const { NodeInstance } = require('../common/inspector-helper.js'); 9 10async function runTest() { 11 const child = new NodeInstance(['--inspect-brk-node=0', '-p', '42']); 12 const session = await child.connectInspectorSession(); 13 await session.send({ method: 'Runtime.enable' }); 14 await session.send({ method: 'Debugger.enable' }); 15 await session.send({ method: 'Runtime.runIfWaitingForDebugger' }); 16 await session.waitForNotification((notification) => { 17 // The main assertion here is that we do hit the loader script first. 18 return notification.method === 'Debugger.scriptParsed' && 19 notification.params.url === 'internal/bootstrap/loaders.js'; 20 }); 21 22 await session.waitForNotification('Debugger.paused'); 23 await session.send({ method: 'Debugger.resume' }); 24 await session.waitForNotification('Debugger.paused'); 25 await session.runToCompletion(); 26} 27 28runTest().then(common.mustCall()); 29