Skip to content

Commit 49967ef

Browse files
committed
test: refactor to top-level await
1 parent 4786bf0 commit 49967ef

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { skipIfInspectorDisabled } from '../common/index.mjs';
2+
3+
skipIfInspectorDisabled();
4+
5+
import { path } from '../common/fixtures.mjs';
6+
import startCLI from '../common/debugger.js';
7+
8+
import assert from 'assert';
9+
10+
const cli = startCLI([path('debugger', 'three-lines.js')]);
11+
12+
try {
13+
await cli.waitForInitialBreak();
14+
await cli.waitForPrompt();
15+
await cli.command('exec a = function func() {}; a;');
16+
assert.match(cli.output, /\[Function: func\]/);
17+
await cli.command('exec a = function func () {}; a;');
18+
assert.match(cli.output, /\[Function\]/);
19+
await cli.command('exec a = function() {}; a;');
20+
assert.match(cli.output, /\[Function: function\]/);
21+
await cli.command('exec a = () => {}; a;');
22+
assert.match(cli.output, /\[Function\]/);
23+
await cli.command('exec a = function* func() {}; a;');
24+
assert.match(cli.output, /\[GeneratorFunction: func\]/);
25+
await cli.command('exec a = function *func() {}; a;');
26+
assert.match(cli.output, /\[GeneratorFunction: \*func\]/);
27+
await cli.command('exec a = function*func() {}; a;');
28+
assert.match(cli.output, /\[GeneratorFunction: function\*func\]/);
29+
await cli.command('exec a = function * func() {}; a;');
30+
assert.match(cli.output, /\[GeneratorFunction\]/);
31+
} finally {
32+
cli.quit();
33+
}

0 commit comments

Comments
 (0)