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

Function runTests

test/parallel/test-inspector-wait.mjs:9–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8
9async function runTests() {
10 const child = new NodeInstance(['--inspect-wait=0'], 'console.log(0);');
11 const session = await child.connectInspectorSession();
12 await session.send({ method: 'NodeRuntime.enable' });
13 await session.waitForNotification('NodeRuntime.waitingForDebugger');
14
15 // The execution should be paused until the debugger is attached
16 while (await child.nextStderrString() !== 'Debugger attached.');
17
18 await session.send({ 'method': 'Runtime.runIfWaitingForDebugger' });
19
20 // Wait for the execution to finish
21 while (await child.nextStderrString() !== 'Waiting for the debugger to disconnect...');
22
23 await session.send({ method: 'NodeRuntime.disable' });
24 session.disconnect();
25 assert.strictEqual((await child.expectShutdown()).exitCode, 0);
26}
27
28runTests().then(common.mustCall());

Callers 1

Calls 6

nextStderrStringMethod · 0.95
expectShutdownMethod · 0.95
waitForNotificationMethod · 0.80
sendMethod · 0.65
disconnectMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…