mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
test: update test-debugger-breakpoint-exists.js to use async/await
PR-URL: https://github.com/nodejs/node/pull/44682 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
@@ -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;
|
||||
(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);
|
||||
}
|
||||
})().then(common.mustCall());
|
||||
|
||||
Reference in New Issue
Block a user