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 authored and Michaël Zasso committed 2021-10-13 10:20:52 +02:00
1 parent d8a36ee1de
commit 07dae7ff50
1 file changed
+6 -7
+6 -7
View File
@@ -104,13 +104,12 @@ function startCLI(args, flags = [], spawnOpts = {}) {
},
async waitForInitialBreak() {
return this.waitFor(/break (?:on start )?in/i)
.then(async () => {
if (isPreBreak(this.output)) {
return this.command('next', false)
.then(() => this.waitFor(/break in/));
}
});
await this.waitFor(/break (?:on start )?in/i);
if (isPreBreak(this.output)) {
await this.command('next', false);
return this.waitFor(/break in/);
}
},
get breakInfo() {