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: #51560
PR-URL: #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 targos committed Oct 4, 2024
1 parent 65c376a commit 93c23e7
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 93c23e7

Please sign in to comment.