Skip to content

Commit

Permalink
test: refactor to top-level await
Browse files Browse the repository at this point in the history
PR-URL: #43366
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
meekdenzo authored and targos committed Jul 12, 2022
1 parent b1a7798 commit a9ab41c
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 a9ab41c

Please sign in to comment.