Skip to content

Commit 5854abc

Browse files
samyuktaprabhujuanarbol
authored andcommitted
test: use async/await in test-debugger-auto-resume
PR-URL: #44675 Reviewed-By: Rich Trott <[email protected]>
1 parent 3e8569c commit 5854abc

File tree

2 files changed

+35
-36
lines changed

2 files changed

+35
-36
lines changed

test/sequential/test-debugger-auto-resume.js

-36
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { skipIfInspectorDisabled } from '../common/index.mjs';
2+
3+
skipIfInspectorDisabled();
4+
5+
import { path as _path } from '../common/fixtures.js';
6+
import startCLI from '../common/debugger.js';
7+
import { addLibraryPath } from '../common/shared-lib-util.js';
8+
9+
import { deepStrictEqual, strictEqual } from 'assert';
10+
import { relative } from 'path';
11+
12+
addLibraryPath(process.env);
13+
14+
// Auto-resume on start if the environment variable is defined.
15+
{
16+
const scriptFullPath = _path('debugger', 'break.js');
17+
const script = relative(process.cwd(), scriptFullPath);
18+
19+
const env = {
20+
...process.env,
21+
};
22+
env.NODE_INSPECT_RESUME_ON_START = '1';
23+
24+
const cli = startCLI([script], [], {
25+
env,
26+
});
27+
28+
await cli.waitForInitialBreak();
29+
deepStrictEqual(cli.breakInfo, {
30+
filename: script,
31+
line: 10,
32+
});
33+
const code = await cli.quit();
34+
strictEqual(code, 0);
35+
}

0 commit comments

Comments
 (0)