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 143c428

Browse filesBrowse files
rathi2016danielleadams
authored andcommitted
test: migrated from Promise chains to Async/Await
PR-URL: #44674 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent e609a33 commit 143c428
Copy full SHA for 143c428

File tree

Expand file treeCollapse file tree

1 file changed

+11
-13
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-13
lines changed
Open diff view settings
Collapse file

‎test/sequential/test-debugger-restart-message.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-restart-message.js
+11-13Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,22 @@ const startCLI = require('../common/debugger');
1616
const script = fixtures.path('debugger', 'three-lines.js');
1717
const cli = startCLI([script]);
1818

19-
function onFatal(error) {
20-
cli.quit();
21-
throw error;
22-
}
23-
2419
const listeningRegExp = /Debugger listening on/g;
2520

26-
cli.waitForInitialBreak()
27-
.then(() => cli.waitForPrompt())
28-
.then(() => {
21+
async function onWaitForInitialBreak() {
22+
try {
23+
await cli.waitForInitialBreak();
24+
await cli.waitForPrompt();
2925
assert.strictEqual(cli.output.match(listeningRegExp).length, 1);
30-
})
31-
.then(async () => {
26+
3227
for (let i = 0; i < RESTARTS; i++) {
3328
await cli.stepCommand('restart');
3429
assert.strictEqual(cli.output.match(listeningRegExp).length, 1);
3530
}
36-
})
37-
.then(() => cli.quit())
38-
.then(null, onFatal);
31+
} finally {
32+
await cli.quit();
33+
}
34+
}
35+
36+
onWaitForInitialBreak();
3937
}

0 commit comments

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