From 143806f9762e37bc180cd192e4817b8f5de6ef18 Mon Sep 17 00:00:00 2001 From: gdccwxx <765553928@qq.com> Date: Wed, 6 Oct 2021 22:22:02 +0800 Subject: [PATCH 1/2] test: fix "test/common/debugger" identify async function --- test/common/debugger.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/common/debugger.js b/test/common/debugger.js index 36d6328dcc9b39..0cb4c54eeecfb1 100644 --- a/test/common/debugger.js +++ b/test/common/debugger.js @@ -103,9 +103,9 @@ function startCLI(args, flags = [], spawnOpts = {}) { return this.waitFor(/>\s+$/); }, - waitForInitialBreak() { + async waitForInitialBreak() { return this.waitFor(/break (?:on start )?in/i) - .then(() => { + .then(async () => { if (isPreBreak(this.output)) { return this.command('next', false) .then(() => this.waitFor(/break in/)); From 1b087f52d1933469c750a641e96ad382a86d62de Mon Sep 17 00:00:00 2001 From: gdccwxx <765553928@qq.com> Date: Thu, 7 Oct 2021 00:53:02 +0800 Subject: [PATCH 2/2] test: replace .then chains with await --- 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() {