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

Function breakOnLine

test/parallel/test-inspector-break-when-eval.js:38–59  ·  view source on GitHub ↗
(session)

Source from the content-addressed store, hash-verified

36}
37
38async function breakOnLine(session) {
39 console.log('[test]', 'Breaking in the code');
40 const commands = [
41 { 'method': 'Debugger.setBreakpointByUrl',
42 'params': { 'lineNumber': 9,
43 'url': pathToFileURL(script).toString(),
44 'columnNumber': 0,
45 'condition': '' } },
46 { 'method': 'Runtime.evaluate',
47 'params': { 'expression': 'sum()',
48 'objectGroup': 'console',
49 'includeCommandLineAPI': true,
50 'silent': false,
51 'contextId': 1,
52 'returnByValue': false,
53 'generatePreview': true,
54 'userGesture': true,
55 'awaitPromise': false } },
56 ];
57 session.send(commands);
58 await session.waitForBreakOnLine(9, pathToFileURL(script).toString());
59}
60
61async function stepOverConsoleStatement(session) {
62 console.log('[test]', 'Step over console statement and test output');

Callers 1

runTestsFunction · 0.85

Calls 5

waitForBreakOnLineMethod · 0.80
sendMethod · 0.65
pathToFileURLFunction · 0.50
logMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected