From 858631f720ef7c717ec3da9e01432c47ec015ea0 Mon Sep 17 00:00:00 2001 From: Nupur Chauhan <31733079+nupurchauhan6@users.noreply.github.com> Date: Sun, 25 Sep 2022 19:15:27 -0400 Subject: [PATCH] test: use async/await in test-debugger-invalid-args PR-URL: https://github.com/nodejs/node/pull/44678 Reviewed-By: Rich Trott --- test/sequential/test-debugger-invalid-args.js | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/test/sequential/test-debugger-invalid-args.js b/test/sequential/test-debugger-invalid-args.js index 36f8e588b04a6e..b137ed04255341 100644 --- a/test/sequential/test-debugger-invalid-args.js +++ b/test/sequential/test-debugger-invalid-args.js @@ -8,24 +8,20 @@ const startCLI = require('../common/debugger'); const assert = require('assert'); // Launch CLI w/o args. -{ +(async () => { const cli = startCLI([]); - cli.quit() - .then((code) => { - assert.strictEqual(code, 1); - assert.match(cli.output, /^Usage:/, 'Prints usage info'); - }); -} + const code = await cli.quit(); + assert.strictEqual(code, 1); + assert.match(cli.output, /^Usage:/, 'Prints usage info'); +})().then(common.mustCall()); // Launch w/ invalid host:port. -{ +(async () => { const cli = startCLI([`localhost:${common.PORT}`]); - cli.quit() - .then((code) => { - assert.match( - cli.output, - /failed to connect/, - 'Tells the user that the connection failed'); - assert.strictEqual(code, 1); - }); -} + const code = await cli.quit(); + assert.match( + cli.output, + /failed to connect/, + 'Tells the user that the connection failed'); + assert.strictEqual(code, 1); +})().then(common.mustCall());