Skip to content

Commit

Permalink
fixup! test: update test-debugger-scripts to use await/async -fix lin…
Browse files Browse the repository at this point in the history
…t errors
  • Loading branch information
Trott committed Sep 28, 2022
1 parent ea87f3f commit d9bad3d
Showing 1 changed file with 5 additions and 36 deletions.
41 changes: 5 additions & 36 deletions test/sequential/test-debugger-scripts.js
Expand Up @@ -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');
Expand All @@ -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);
}

0 comments on commit d9bad3d

Please sign in to comment.