Skip to content

Commit 143c428

Browse files
rathi2016danielleadams
authored andcommitted
test: migrated from Promise chains to Async/Await
PR-URL: #44674 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent e609a33 commit 143c428

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

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

+11-13
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)