diff --git a/test/parallel/test-debugger-exceptions.js b/test/parallel/test-debugger-exceptions.js index 3f75161a6b6e3d..117a39c83af479 100644 --- a/test/parallel/test-debugger-exceptions.js +++ b/test/parallel/test-debugger-exceptions.js @@ -27,7 +27,9 @@ const path = require('path'); await cli.waitFor(/disconnect/); // Next run: With `breakOnException` it pauses in both places. - await cli.stepCommand('r'); + await cli.command('r'); + await cli.waitFor(/Debugger attached\./); + await cli.waitForPrompt(); await cli.waitForInitialBreak(); assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 }); await cli.command('breakOnException'); @@ -38,7 +40,9 @@ const path = require('path'); // Next run: With `breakOnUncaught` it only pauses on the 2nd exception. await cli.command('breakOnUncaught'); - await cli.stepCommand('r'); // Also, the setting survives the restart. + await cli.command('r'); // Also, the setting survives the restart. + await cli.waitFor(/Debugger attached\./); + await cli.waitForPrompt(); await cli.waitForInitialBreak(); assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 }); await cli.stepCommand('c'); @@ -46,7 +50,9 @@ const path = require('path'); // Next run: Back to the initial state! It should die again. await cli.command('breakOnNone'); - await cli.stepCommand('r'); + await cli.command('r'); + await cli.waitFor(/Debugger attached\./); + await cli.waitForPrompt(); await cli.waitForInitialBreak(); assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 }); await cli.command('c');