From d6cdb1801753c9a47539620daa34c5a001fd3fbb Mon Sep 17 00:00:00 2001 From: Madhulika_Sharma Date: Fri, 16 Sep 2022 16:09:18 -0400 Subject: [PATCH 1/2] test: change promises to async/await --- test/sequential/test-debugger-launch.js | 47 ------------------------ test/sequential/test-debugger-launch.mjs | 35 ++++++++++++++++++ 2 files changed, 35 insertions(+), 47 deletions(-) delete mode 100644 test/sequential/test-debugger-launch.js create mode 100644 test/sequential/test-debugger-launch.mjs diff --git a/test/sequential/test-debugger-launch.js b/test/sequential/test-debugger-launch.js deleted file mode 100644 index 3bfe541ecca05c..00000000000000 --- a/test/sequential/test-debugger-launch.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; -const common = require('../common'); - -common.skipIfInspectorDisabled(); - -const fixtures = require('../common/fixtures'); -const startCLI = require('../common/debugger'); - -const assert = require('assert'); - -{ - const script = fixtures.path('debugger', 'three-lines.js'); - const cli = startCLI([script]); - - cli.waitForInitialBreak() - .then(() => cli.waitForPrompt()) - .then(() => { - assert.match(cli.output, /debug>/, 'prints a prompt'); - assert.match( - cli.output, - /< Debugger listening on [^\n]*9229/, - 'forwards child output'); - }) - .then(() => cli.command('["hello", "world"].join(" ")')) - .then(() => { - assert.match(cli.output, /hello world/, 'prints the result'); - }) - .then(() => cli.command('')) - .then(() => { - assert.match( - cli.output, - /hello world/, - 'repeats the last command on ' - ); - }) - .then(() => cli.command('version')) - .then(() => { - assert.ok( - cli.output.includes(process.versions.v8), - 'version prints the v8 version' - ); - }) - .then(() => cli.quit()) - .then((code) => { - assert.strictEqual(code, 0); - }); -} diff --git a/test/sequential/test-debugger-launch.mjs b/test/sequential/test-debugger-launch.mjs new file mode 100644 index 00000000000000..07cabfda3e9121 --- /dev/null +++ b/test/sequential/test-debugger-launch.mjs @@ -0,0 +1,35 @@ +import { skipIfInspectorDisabled } from '../common/index.mjs'; +skipIfInspectorDisabled(); + +import { path } from '../common/fixtures.mjs'; +import startCLI from '../common/debugger.js'; + +import assert from 'assert'; +const script = path('debugger', 'three-lines.js'); +const cli = startCLI([script]); +try { + await cli.waitForInitialBreak(); + await cli.waitForPrompt(); + assert.match(cli.output, /debug>/, 'prints a prompt'); + assert.match( + cli.output, + /< Debugger listening on [^\n]*9229/, + 'forwards child output' + ); + await cli.command('["hello", "world"].join(" ")'); + assert.match(cli.output, /hello world/, 'prints the result'); + await cli.command(''); + assert.match( + cli.output, + /hello world/, + 'repeats the last command on ' + ); + await cli.command('version'); + assert.ok( + cli.output.includes(process.versions.v8), + 'version prints the v8 version' + ); +} finally { + const code = await cli.quit(); + assert.strictEqual(code, 0); +} From d8a62f93ea4f16806ad01ee4661930bff022cb7c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 25 Sep 2022 09:54:47 -0700 Subject: [PATCH 2/2] Update test/sequential/test-debugger-launch.mjs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tobias Nießen --- test/sequential/test-debugger-launch.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/sequential/test-debugger-launch.mjs b/test/sequential/test-debugger-launch.mjs index 07cabfda3e9121..9d4016c1f5d5e4 100644 --- a/test/sequential/test-debugger-launch.mjs +++ b/test/sequential/test-debugger-launch.mjs @@ -5,6 +5,7 @@ import { path } from '../common/fixtures.mjs'; import startCLI from '../common/debugger.js'; import assert from 'assert'; + const script = path('debugger', 'three-lines.js'); const cli = startCLI([script]); try {