test: replace .then chains with await

PR-URL: https://github.com/nodejs/node/pull/40348
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
gdccwxx 2021-10-07 00:53:02 +08:00 committed by Node.js GitHub Bot
parent 5b4ba52786
commit 24f045dae2
1 changed files with 6 additions and 7 deletions

View File

@ -104,13 +104,12 @@ function startCLI(args, flags = [], spawnOpts = {}) {
}, },
async waitForInitialBreak() { async waitForInitialBreak() {
return this.waitFor(/break (?:on start )?in/i) await this.waitFor(/break (?:on start )?in/i);
.then(async () => {
if (isPreBreak(this.output)) { if (isPreBreak(this.output)) {
return this.command('next', false) await this.command('next', false);
.then(() => this.waitFor(/break in/)); return this.waitFor(/break in/);
} }
});
}, },
get breakInfo() { get breakInfo() {