Skip to content

Commit

Permalink
test: update test-debugger-breakpoint-exists.js to use async/await
Browse files Browse the repository at this point in the history
  • Loading branch information
archana-kamath committed Sep 16, 2022
1 parent 85b46e1 commit 8e639e9
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions test/sequential/test-debugger-breakpoint-exists.js
Expand Up @@ -8,20 +8,17 @@ const fixtures = require('../common/fixtures');
const startCLI = require('../common/debugger');

// Test for "Breakpoint at specified location already exists" error.
{
const script = fixtures.path('debugger', 'three-lines.js');
const cli = startCLI([script]);
const script = fixtures.path('debugger', 'three-lines.js');
const cli = startCLI([script]);

function onFatal(error) {
cli.quit();
throw error;
(common.mustCall(async () => {
try {
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('setBreakpoint(1)');
await cli.command('setBreakpoint(1)');
await cli.waitFor(/Breakpoint at specified location already exists/);
} finally {
await cli.quit();
}

cli.waitForInitialBreak()
.then(() => cli.waitForPrompt())
.then(() => cli.command('setBreakpoint(1)'))
.then(() => cli.command('setBreakpoint(1)'))
.then(() => cli.waitFor(/Breakpoint at specified location already exists/))
.then(() => cli.quit())
.then(null, onFatal);
}
}))();

0 comments on commit 8e639e9

Please sign in to comment.