Skip to content

Commit

Permalink
test: deflake test-inspector-strip-types
Browse files Browse the repository at this point in the history
Use the `NodeRuntime.waitingForDebugger` event.

Refs: nodejs#51560
PR-URL: nodejs#55058
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
  • Loading branch information
lpinca authored and louwers committed Nov 2, 2024
1 parent 0f99c7c commit fde32fc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/parallel/test-inspector-strip-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ async function runTest() {

const session = await child.connectInspectorSession();

const commands = [
await session.send({ method: 'NodeRuntime.enable' });
await session.waitForNotification('NodeRuntime.waitingForDebugger');
await session.send([
{ 'method': 'Debugger.enable' },
{ 'method': 'Runtime.enable' },
{ 'method': 'Runtime.runIfWaitingForDebugger' },
];

await session.send(commands);
]);
await session.send({ method: 'NodeRuntime.disable' });

const scriptParsed = await session.waitForNotification((notification) => {
if (notification.method !== 'Debugger.scriptParsed') return false;
Expand Down

0 comments on commit fde32fc

Please sign in to comment.