From 07dae7ff50a2a78e13ea428f994ac2cb3e9dff06 Mon Sep 17 00:00:00 2001 From: gdccwxx <765553928@qq.com> Date: Thu, 7 Oct 2021 00:53:02 +0800 Subject: [PATCH] test: replace .then chains with await MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/40348 Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso --- test/common/debugger.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/common/debugger.js b/test/common/debugger.js index 0cb4c54eeecfb1..d2ac4f3b6c5fbf 100644 --- a/test/common/debugger.js +++ b/test/common/debugger.js @@ -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() {