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

Function testBreakpointOnStart

test/parallel/test-inspector-esm.js:21–45  ·  view source on GitHub ↗
(session)

Source from the content-addressed store, hash-verified

19}
20
21async function testBreakpointOnStart(session) {
22 console.log('[test]',
23 'Verifying debugger stops on start (--inspect-brk option)');
24 const commands = [
25 { 'method': 'Runtime.enable' },
26 { 'method': 'Debugger.enable' },
27 { 'method': 'Debugger.setPauseOnExceptions',
28 'params': { 'state': 'none' } },
29 { 'method': 'Debugger.setAsyncCallStackDepth',
30 'params': { 'maxDepth': 0 } },
31 { 'method': 'Profiler.enable' },
32 { 'method': 'Profiler.setSamplingInterval',
33 'params': { 'interval': 100 } },
34 { 'method': 'Debugger.setBlackboxPatterns',
35 'params': { 'patterns': [] } },
36 { 'method': 'Runtime.runIfWaitingForDebugger' },
37 ];
38
39 await session.send({ method: 'NodeRuntime.enable' });
40 await session.waitForNotification('NodeRuntime.waitingForDebugger');
41 await session.send(commands);
42 await session.send({ method: 'NodeRuntime.disable' });
43 await session.waitForBreakOnLine(
44 0, UrlResolve(session.scriptURL().toString(), 'message.mjs'));
45}
46
47async function testBreakpoint(session) {
48 console.log('[test]', 'Setting a breakpoint and verifying it is hit');

Callers 1

runTestFunction · 0.70

Calls 6

waitForNotificationMethod · 0.80
waitForBreakOnLineMethod · 0.80
scriptURLMethod · 0.80
sendMethod · 0.65
logMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…