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

Function runTests

test/parallel/test-inspector-stop-profile-after-done.js:7–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5const { NodeInstance } = require('../common/inspector-helper.js');
6
7async function runTests() {
8 const child = new NodeInstance(['--inspect-brk=0'],
9 `let c = 0;
10 const interval = setInterval(() => {
11 console.log(new Object());
12 if (c++ === 10)
13 clearInterval(interval);
14 }, ${common.platformTimeout(30)});`);
15 const session = await child.connectInspectorSession();
16
17 await session.send({ method: 'NodeRuntime.enable' });
18 await session.waitForNotification('NodeRuntime.waitingForDebugger');
19 await session.send([
20 { method: 'Profiler.setSamplingInterval',
21 params: { interval: common.platformTimeout(300) } },
22 { method: 'Profiler.enable' }]);
23 await session.send({ method: 'Runtime.runIfWaitingForDebugger' });
24 await session.send({ method: 'NodeRuntime.disable' });
25 await session.send({ method: 'Profiler.start' });
26 while (await child.nextStderrString() !==
27 'Waiting for the debugger to disconnect...');
28 await session.send({ method: 'Profiler.stop' });
29 session.disconnect();
30 assert.strictEqual((await child.expectShutdown()).exitCode, 0);
31}
32
33runTests().then(common.mustCall());

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…