diff --git a/test/parallel/test-debugger-exceptions.js b/test/parallel/test-debugger-exceptions.js index 3f75161a6b6e3d..27818612301163 100644 --- a/test/parallel/test-debugger-exceptions.js +++ b/test/parallel/test-debugger-exceptions.js @@ -27,8 +27,10 @@ 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(/ ok\n/); await cli.waitForInitialBreak(); + await cli.waitForPrompt(); assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 }); await cli.command('breakOnException'); await cli.stepCommand('c'); @@ -38,16 +40,20 @@ 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(/ ok\n/); await cli.waitForInitialBreak(); + await cli.waitForPrompt(); assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 }); await cli.stepCommand('c'); assert.ok(cli.output.includes(`exception in ${script}:9`)); // 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(/ ok\n/); await cli.waitForInitialBreak(); + await cli.waitForPrompt(); assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 }); await cli.command('c'); await cli.waitFor(/disconnect/);