Skip to content

Commit

Permalink
test: refactor to top-level await
Browse files Browse the repository at this point in the history
PR-URL: nodejs/node#43366
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
meekdenzo authored and guangwong committed Oct 10, 2022
1 parent 0c5ddec commit 72e7249
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
'use strict';
const common = require('../common');
import { skipIfInspectorDisabled } from '../common/index.mjs';

common.skipIfInspectorDisabled();
skipIfInspectorDisabled();

const fixtures = require('../common/fixtures');
const startCLI = require('../common/debugger');
import { path } from '../common/fixtures.mjs';
import startCLI from '../common/debugger.js';

const assert = require('assert');
import assert from 'assert';

const cli = startCLI([fixtures.path('debugger', 'three-lines.js')]);
const cli = startCLI([path('debugger', 'three-lines.js')]);

(async () => {
try {
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('exec a = function func() {}; a;');
Expand All @@ -29,6 +28,6 @@ const cli = startCLI([fixtures.path('debugger', 'three-lines.js')]);
assert.match(cli.output, /\[GeneratorFunction: function\*func\]/);
await cli.command('exec a = function * func() {}; a;');
assert.match(cli.output, /\[GeneratorFunction\]/);
})()
.finally(() => cli.quit())
.then(common.mustCall());
} finally {
cli.quit();
}

0 comments on commit 72e7249

Please sign in to comment.