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

Function test

test/parallel/test-inspector-async-context-brk.js:25–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23}
24
25async function test() {
26 const session = new Session();
27
28 session.connect();
29 session.post('Debugger.enable');
30
31 session.on('Debugger.paused', () => {
32 valueInBreakpoint = getStore();
33 });
34
35 await new Promise((resolve, reject) => {
36 session.post('Debugger.setBreakpointByUrl', {
37 'lineNumber': 22,
38 'url': pathToFileURL(path.resolve(__dirname, __filename)).toString(),
39 'columnNumber': 0,
40 'condition': ''
41 }, (error, result) => {
42 return error ? reject(error) : resolve(result);
43 });
44 });
45
46 als.run(1, debugged);
47 assert.strictEqual(valueInFunction, valueInBreakpoint);
48 assert.strictEqual(valueInFunction, 1);
49
50 session.disconnect();
51}
52
53const interval = setInterval(() => {}, 1000);
54test().then(common.mustCall(() => {

Calls 11

connectMethod · 0.95
postMethod · 0.95
disconnectMethod · 0.95
getStoreFunction · 0.85
pathToFileURLFunction · 0.50
rejectFunction · 0.50
resolveFunction · 0.50
onMethod · 0.45
toStringMethod · 0.45
resolveMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…