Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! async_hooks,inspector: implement inspector api without async_wrap
  • Loading branch information
dygabo committed Jan 23, 2024
commit bf08b03d32db80d3f5518a89fc4e94c1d7634825
12 changes: 0 additions & 12 deletions test/parallel/test-inspector-async-context-brk.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,17 @@ let valueInBreakpoint = 0;

function debugged() {
valueInFunction = getStore();
console.log('in code => ', getStore());
return 42;
}

async function test() {
const session = new Session();

session.connect();
console.log('Connected');

session.post('Debugger.enable');
console.log('Debugger was enabled');

session.on('Debugger.paused', () => {
valueInBreakpoint = getStore();
console.log('on Debugger.paused callback => ', getStore());
});

await new Promise((resolve, reject) => {
Expand All @@ -47,22 +42,15 @@ async function test() {
return error ? reject(error) : resolve(result);
});
});
console.log('Breakpoint was set');

als.run(1, debugged);
assert.strictEqual(valueInFunction, valueInBreakpoint);
assert.strictEqual(valueInFunction, 1);
assert.notStrictEqual(valueInFunction, 0);
assert.notStrictEqual(valueInBreakpoint, 0);

console.log('Breakpoint was hit');

session.disconnect();
console.log('Session disconnected');
}

const interval = setInterval(() => {}, 1000);
test().then(common.mustCall(() => {
clearInterval(interval);
console.log('Done!');
}));