From 6da72b25841d536e8d92e0dce1496addfc4fd1c9 Mon Sep 17 00:00:00 2001 From: Priya Shastri <97130930+pshastricb@users.noreply.github.com> Date: Fri, 16 Sep 2022 12:29:07 -0700 Subject: [PATCH 1/4] test: modify test-debugger-custom-port.js to use async-await --- test/sequential/test-debugger-custom-port.js | 37 ++++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/test/sequential/test-debugger-custom-port.js b/test/sequential/test-debugger-custom-port.js index e6cee10ffa53b5..6c413809b29f16 100644 --- a/test/sequential/test-debugger-custom-port.js +++ b/test/sequential/test-debugger-custom-port.js @@ -1,4 +1,4 @@ -'use strict'; +use strict'; const common = require('../common'); common.skipIfInspectorDisabled(); @@ -9,22 +9,21 @@ const startCLI = require('../common/debugger'); const assert = require('assert'); // Custom port. -{ - const script = fixtures.path('debugger', 'three-lines.js'); +const script = fixtures.path('debugger', 'three-lines.js'); - const cli = startCLI([`--port=${common.PORT}`, script]); - - cli.waitForInitialBreak() - .then(() => cli.waitForPrompt()) - .then(() => { - assert.match(cli.output, /debug>/, 'prints a prompt'); - assert.match( - cli.output, - new RegExp(`< Debugger listening on [^\n]*${common.PORT}`), - 'forwards child output'); - }) - .then(() => cli.quit()) - .then((code) => { - assert.strictEqual(code, 0); - }); -} +const cli = startCLI([`--port=${common.PORT}`, script]); +(async function() { + try + { + await cli.waitForInitialBreak(); + await cli.waitForPrompt(); + assert.match(cli.output, /debug>/, 'prints a prompt'); + assert.match( + cli.output, + new RegExp(`< Debugger listening on [^\n]*${common.PORT}`), + 'forwards child output'); + } finally { + const code = await cli.quit(); + assert.strictEqual(code, 0); + } +})(); From c2cc46f73841d7e8d60ab102ad22fe782bb260f4 Mon Sep 17 00:00:00 2001 From: Priya Shastri <97130930+pshastricb@users.noreply.github.com> Date: Fri, 16 Sep 2022 12:39:56 -0700 Subject: [PATCH 2/4] test:modify test-debugger-custom-port.js to use async-await --- test/sequential/test-debugger-custom-port.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sequential/test-debugger-custom-port.js b/test/sequential/test-debugger-custom-port.js index 6c413809b29f16..e765e51cd55881 100644 --- a/test/sequential/test-debugger-custom-port.js +++ b/test/sequential/test-debugger-custom-port.js @@ -1,4 +1,4 @@ -use strict'; +'use strict'; const common = require('../common'); common.skipIfInspectorDisabled(); From b604a1bb25666c09a8c34986bf1f26184eefa740 Mon Sep 17 00:00:00 2001 From: Priya Shastri <97130930+pshastricb@users.noreply.github.com> Date: Fri, 16 Sep 2022 13:44:40 -0700 Subject: [PATCH 3/4] test:modify the code to add mustcall --- test/sequential/test-debugger-custom-port.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sequential/test-debugger-custom-port.js b/test/sequential/test-debugger-custom-port.js index e765e51cd55881..ca62e90b6b52d1 100644 --- a/test/sequential/test-debugger-custom-port.js +++ b/test/sequential/test-debugger-custom-port.js @@ -26,4 +26,4 @@ const cli = startCLI([`--port=${common.PORT}`, script]); const code = await cli.quit(); assert.strictEqual(code, 0); } -})(); +})().then(common.mustCall()); From d3f94232e8c34e1a3f159fabe409e21b65618610 Mon Sep 17 00:00:00 2001 From: Priya Shastri <97130930+pshastricb@users.noreply.github.com> Date: Fri, 16 Sep 2022 14:26:19 -0700 Subject: [PATCH 4/4] test:modify the file for removal of lint errors --- test/sequential/test-debugger-custom-port.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/sequential/test-debugger-custom-port.js b/test/sequential/test-debugger-custom-port.js index ca62e90b6b52d1..7c8abdc0c55174 100644 --- a/test/sequential/test-debugger-custom-port.js +++ b/test/sequential/test-debugger-custom-port.js @@ -13,15 +13,14 @@ const script = fixtures.path('debugger', 'three-lines.js'); const cli = startCLI([`--port=${common.PORT}`, script]); (async function() { - try - { + try { await cli.waitForInitialBreak(); await cli.waitForPrompt(); assert.match(cli.output, /debug>/, 'prints a prompt'); assert.match( - cli.output, - new RegExp(`< Debugger listening on [^\n]*${common.PORT}`), - 'forwards child output'); + cli.output, + new RegExp(`< Debugger listening on [^\n]*${common.PORT}`), + 'forwards child output'); } finally { const code = await cli.quit(); assert.strictEqual(code, 0);