Skip to content

Commit

Permalink
test: migrated from Promise chains to Async/Await
Browse files Browse the repository at this point in the history
  • Loading branch information
rathi2016 committed Sep 16, 2022
1 parent 5d92ddc commit 5395b67
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions test/sequential/test-debugger-restart-message.js
Expand Up @@ -16,24 +16,24 @@ const startCLI = require('../common/debugger');
const script = fixtures.path('debugger', 'three-lines.js');
const cli = startCLI([script]);

function onFatal(error) {
cli.quit();
throw error;
}

const listeningRegExp = /Debugger listening on/g;

cli.waitForInitialBreak()
.then(() => cli.waitForPrompt())
.then(() => {
async function onWaitForInitialBreak() {
try {
await cli.waitForInitialBreak();
await cli.waitForPrompt();
assert.strictEqual(cli.output.match(listeningRegExp).length, 1);
})
.then(async () => {

for (let i = 0; i < RESTARTS; i++) {
await cli.stepCommand('restart');
assert.strictEqual(cli.output.match(listeningRegExp).length, 1);
}
})
.then(() => cli.quit())
.then(null, onFatal);
}
finally{
await cli.quit();
}
}

onWaitForInitialBreak();
}

0 comments on commit 5395b67

Please sign in to comment.