-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: use async/await in test-debugger-auto-resume
PR-URL: #44675 Reviewed-By: Rich Trott <rtrott@gmail.com>
- Loading branch information
1 parent
b27b336
commit 117f068
Showing
2 changed files
with
35 additions
and
36 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { skipIfInspectorDisabled } from '../common/index.mjs'; | ||
|
||
skipIfInspectorDisabled(); | ||
|
||
import { path as _path } from '../common/fixtures.js'; | ||
import startCLI from '../common/debugger.js'; | ||
import { addLibraryPath } from '../common/shared-lib-util.js'; | ||
|
||
import { deepStrictEqual, strictEqual } from 'assert'; | ||
import { relative } from 'path'; | ||
|
||
addLibraryPath(process.env); | ||
|
||
// Auto-resume on start if the environment variable is defined. | ||
{ | ||
const scriptFullPath = _path('debugger', 'break.js'); | ||
const script = relative(process.cwd(), scriptFullPath); | ||
|
||
const env = { | ||
...process.env, | ||
}; | ||
env.NODE_INSPECT_RESUME_ON_START = '1'; | ||
|
||
const cli = startCLI([script], [], { | ||
env, | ||
}); | ||
|
||
await cli.waitForInitialBreak(); | ||
deepStrictEqual(cli.breakInfo, { | ||
filename: script, | ||
line: 10, | ||
}); | ||
const code = await cli.quit(); | ||
strictEqual(code, 0); | ||
} |