From d9bad3d2098e3feb3ba678b60c5553727fef33d6 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 26 Sep 2022 15:23:06 -0700 Subject: [PATCH] fixup! test: update test-debugger-scripts to use await/async -fix lint errors --- test/sequential/test-debugger-scripts.js | 41 +++--------------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/test/sequential/test-debugger-scripts.js b/test/sequential/test-debugger-scripts.js index 72e77f2e20e11c..ddef77dd35177c 100644 --- a/test/sequential/test-debugger-scripts.js +++ b/test/sequential/test-debugger-scripts.js @@ -13,39 +13,8 @@ const assert = require('assert'); const script = fixtures.path('debugger', 'three-lines.js'); const cli = startCLI([script]); - function onFatal(error) { - cli.quit(); - throw error; - } - - // return cli.waitForInitialBreak() - // .then(() => cli.waitForPrompt()) - // .then(() => cli.command('scripts')) - // .then(() => { - // assert.match( - // cli.output, - // /^\* \d+: \S+debugger(?:\/|\\)three-lines\.js/m, - // 'lists the user script'); - // assert.doesNotMatch( - // cli.output, - // /\d+: node:internal\/buffer/, - // 'omits node-internal scripts'); - // }) - // .then(() => cli.command('scripts(true)')) - // .then(() => { - // assert.match( - // cli.output, - // /\* \d+: \S+debugger(?:\/|\\)three-lines\.js/, - // 'lists the user script'); - // assert.match( - // cli.output, - // /\d+: node:internal\/buffer/, - // 'includes node-internal scripts'); - // }) - // .then(() => cli.quit()) - // .then(null, onFatal); - (async () => { + try { await cli.waitForInitialBreak(); await cli.waitForPrompt(); await cli.command('scripts'); @@ -66,8 +35,8 @@ const assert = require('assert'); cli.output, /\d+: node:internal\/buffer/, 'includes node-internal scripts'); - })() - .then(() => cli.quit()) - .then(null, onFatal); - + } finally { + await cli.quit(); + } + })().then(common.mustCall); }