MCPcopy Index your code
hub / github.com/nodejs/node / runTest

Function runTest

test/parallel/test-inspector-inspect-brk-node.js:10–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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: 'NodeRuntime.enable' });
14 await session.waitForNotification('NodeRuntime.waitingForDebugger');
15 await session.send({ method: 'Runtime.enable' });
16 await session.send({ method: 'Debugger.enable' });
17 await session.send({ method: 'Runtime.runIfWaitingForDebugger' });
18 await session.send({ method: 'NodeRuntime.disable' });
19 await session.waitForNotification((notification) => {
20 // The main assertion here is that we do hit the loader script first.
21 return notification.method === 'Debugger.scriptParsed' &&
22 notification.params.url === 'node:internal/bootstrap/realm';
23 });
24
25 await session.waitForNotification('Debugger.paused');
26 await session.send({ method: 'Debugger.resume' });
27 await session.waitForNotification('Debugger.paused');
28 await session.runToCompletion();
29}
30
31runTest().then(common.mustCall());

Calls 4

waitForNotificationMethod · 0.80
runToCompletionMethod · 0.80
sendMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…