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

Function setupInspector

test/parallel/test-inspector-worker-target.js:12–24  ·  view source on GitHub ↗
(session, sessionId = undefined)

Source from the content-addressed store, hash-verified

10const { NodeInstance } = require('../common/inspector-helper.js');
11
12async function setupInspector(session, sessionId = undefined) {
13 await session.send({ method: 'NodeRuntime.enable', sessionId });
14 await session.waitForNotification('NodeRuntime.waitingForDebugger');
15 await session.send({ method: 'Runtime.enable', sessionId });
16 await session.send({ method: 'Debugger.enable', sessionId });
17 await session.send({ method: 'Runtime.runIfWaitingForDebugger', sessionId });
18 await session.send({ method: 'NodeRuntime.disable', sessionId });
19 await session.waitForNotification((notification) => {
20 return notification.method === 'Debugger.scriptParsed' &&
21 notification.params.url === 'node:internal/bootstrap/realm' &&
22 notification.sessionId === sessionId;
23 });
24}
25
26async function assertTargetAttachedState(session, targetId, attached) {
27 const { targetInfos } = await session.send({ method: 'Target.getTargets' });

Callers 1

testFunction · 0.70

Calls 2

waitForNotificationMethod · 0.80
sendMethod · 0.65

Tested by 1

testFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…