When I moved node-inspect into core, I called a lot of things `inspector-cli` that really should have been `debugger`. This is the last of them to be renamed. PR-URL: https://github.com/nodejs/node/pull/39156 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
36 lines
913 B
JavaScript
36 lines
913 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
common.skipIfInspectorDisabled();
|
|
|
|
const fixtures = require('../common/fixtures');
|
|
const startCLI = require('../common/debugger');
|
|
const { addLibraryPath } = require('../common/shared-lib-util');
|
|
|
|
const assert = require('assert');
|
|
const path = require('path');
|
|
|
|
addLibraryPath(process.env);
|
|
|
|
// Auto-resume on start if the environment variable is defined.
|
|
{
|
|
const scriptFullPath = fixtures.path('debugger', 'break.js');
|
|
const script = path.relative(process.cwd(), scriptFullPath);
|
|
|
|
const env = { ...process.env };
|
|
env.NODE_INSPECT_RESUME_ON_START = '1';
|
|
|
|
const cli = startCLI([script], [], { env });
|
|
|
|
cli.waitForInitialBreak()
|
|
.then(() => {
|
|
assert.deepStrictEqual(
|
|
cli.breakInfo,
|
|
{ filename: script, line: 10 },
|
|
);
|
|
})
|
|
.then(() => cli.quit())
|
|
.then((code) => {
|
|
assert.strictEqual(code, 0);
|
|
});
|
|
}
|