Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test-debugger-auto-resume - promise to async/await #44675

Merged
merged 1 commit into from Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 0 additions & 36 deletions test/sequential/test-debugger-auto-resume.js

This file was deleted.

35 changes: 35 additions & 0 deletions test/sequential/test-debugger-auto-resume.mjs
@@ -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);
}