Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0fb669e

Browse filesBrowse files
archana-kamathdanielleadams
authored andcommitted
test: update test-debugger-breakpoint-exists.js to use async/await
PR-URL: #44682 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent cca2535 commit 0fb669e
Copy full SHA for 0fb669e

File tree

Expand file treeCollapse file tree

1 file changed

+12
-15
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-15
lines changed
Open diff view settings
Collapse file

‎test/sequential/test-debugger-breakpoint-exists.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-breakpoint-exists.js
+12-15Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,17 @@ const fixtures = require('../common/fixtures');
88
const startCLI = require('../common/debugger');
99

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

15-
function onFatal(error) {
16-
cli.quit();
17-
throw error;
14+
(async () => {
15+
try {
16+
await cli.waitForInitialBreak();
17+
await cli.waitForPrompt();
18+
await cli.command('setBreakpoint(1)');
19+
await cli.command('setBreakpoint(1)');
20+
await cli.waitFor(/Breakpoint at specified location already exists/);
21+
} finally {
22+
await cli.quit();
1823
}
19-
20-
cli.waitForInitialBreak()
21-
.then(() => cli.waitForPrompt())
22-
.then(() => cli.command('setBreakpoint(1)'))
23-
.then(() => cli.command('setBreakpoint(1)'))
24-
.then(() => cli.waitFor(/Breakpoint at specified location already exists/))
25-
.then(() => cli.quit())
26-
.then(null, onFatal);
27-
}
24+
})().then(common.mustCall());

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.