Skip to content

Commit a9ab41c

Browse files
meekdenzotargos
authored andcommittedJul 12, 2022
test: refactor to top-level await
PR-URL: #43366 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent b1a7798 commit a9ab41c

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
'use strict';
2-
const common = require('../common');
1+
import { skipIfInspectorDisabled } from '../common/index.mjs';
32

4-
common.skipIfInspectorDisabled();
3+
skipIfInspectorDisabled();
54

6-
const fixtures = require('../common/fixtures');
7-
const startCLI = require('../common/debugger');
5+
import { path } from '../common/fixtures.mjs';
6+
import startCLI from '../common/debugger.js';
87

9-
const assert = require('assert');
8+
import assert from 'assert';
109

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

13-
(async () => {
12+
try {
1413
await cli.waitForInitialBreak();
1514
await cli.waitForPrompt();
1615
await cli.command('exec a = function func() {}; a;');
@@ -29,6 +28,6 @@ const cli = startCLI([fixtures.path('debugger', 'three-lines.js')]);
2928
assert.match(cli.output, /\[GeneratorFunction: function\*func\]/);
3029
await cli.command('exec a = function * func() {}; a;');
3130
assert.match(cli.output, /\[GeneratorFunction\]/);
32-
})()
33-
.finally(() => cli.quit())
34-
.then(common.mustCall());
31+
} finally {
32+
cli.quit();
33+
}

0 commit comments

Comments
 (0)
Please sign in to comment.