Skip to content

Commit 06a3414

Browse files
committed
Migrated from Promise chains to Async/Await
1 parent 5d92ddc commit 06a3414

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

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

+13-13
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@ 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+
}
32+
finally{
33+
await cli.quit();
34+
}
35+
}
36+
37+
onWaitForInitialBreak();
3938
}
39+

0 commit comments

Comments
 (0)