Skip to content

Commit b512436

Browse files
MadhulikaSharma95RafaelGSS
authored andcommitted
test: change promises to async/await
PR-URL: #44683 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent f274b08 commit b512436

File tree

2 files changed

+36
-47
lines changed

2 files changed

+36
-47
lines changed

test/sequential/test-debugger-launch.js

-47
This file was deleted.
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { skipIfInspectorDisabled } from '../common/index.mjs';
2+
skipIfInspectorDisabled();
3+
4+
import { path } from '../common/fixtures.mjs';
5+
import startCLI from '../common/debugger.js';
6+
7+
import assert from 'assert';
8+
9+
const script = path('debugger', 'three-lines.js');
10+
const cli = startCLI([script]);
11+
try {
12+
await cli.waitForInitialBreak();
13+
await cli.waitForPrompt();
14+
assert.match(cli.output, /debug>/, 'prints a prompt');
15+
assert.match(
16+
cli.output,
17+
/< Debugger listening on [^\n]*9229/,
18+
'forwards child output'
19+
);
20+
await cli.command('["hello", "world"].join(" ")');
21+
assert.match(cli.output, /hello world/, 'prints the result');
22+
await cli.command('');
23+
assert.match(
24+
cli.output,
25+
/hello world/,
26+
'repeats the last command on <enter>'
27+
);
28+
await cli.command('version');
29+
assert.ok(
30+
cli.output.includes(process.versions.v8),
31+
'version prints the v8 version'
32+
);
33+
} finally {
34+
const code = await cli.quit();
35+
assert.strictEqual(code, 0);
36+
}

0 commit comments

Comments
 (0)