node/test/sea/test-single-executable-application-inspect-in-sea-flags.js
Joyee Cheung 6eaf1b85ed
test: migrate to --build-sea in existing SEA tests
Only leave a smoking test for the postject-based workflow
in test-single-executable-application.js

PR-URL: https://github.com/nodejs/node/pull/61167
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-01-22 23:32:51 +01:00

44 lines
972 B
JavaScript

'use strict';
// This tests that the debugger flag --inspect passed directly to a single executable
// application would not be consumed by Node.js but passed to the application
// instead.
require('../common');
const assert = require('assert');
const { spawnSyncAndAssert } = require('../common/child_process');
const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');
const {
buildSEA,
skipIfBuildSEAIsNotSupported,
} = require('../common/sea');
skipIfBuildSEAIsNotSupported();
tmpdir.refresh();
const outputFile = buildSEA(fixtures.path('sea', 'inspect-in-sea-flags'));
// Spawn the SEA with inspect option
spawnSyncAndAssert(
outputFile,
['--inspect=0'],
{
env: {
...process.env,
},
},
{
stdout(data) {
assert.match(data, /--inspect=0/);
return true;
},
stderr(data) {
assert.doesNotMatch(data, /Debugger listening/);
return true;
},
trim: true,
},
);