Files
node/test/sea/test-single-executable-application-exec-argv.js
T
Joyee Cheung 345a40fda3 test: use fixture directories for sea tests
Instead of copying and writing files on the fly for SEA tests,
put the fixtures into a directory and copy them into tmpdir
for testing. This allows easier reproduction and debugging
when they do fail - we can just copy the entire fixture directory
and test directly from there.

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

44 lines
1.0 KiB
JavaScript

'use strict';
require('../common');
const {
generateSEA,
skipIfSingleExecutableIsNotSupported,
} = require('../common/sea');
skipIfSingleExecutableIsNotSupported();
// This tests the execArgv functionality with multiple arguments in single executable applications.
const tmpdir = require('../common/tmpdir');
const { spawnSyncAndAssert } = require('../common/child_process');
const { join } = require('path');
const fixtures = require('../common/fixtures');
const assert = require('assert');
tmpdir.refresh();
const outputFile = generateSEA(fixtures.path('sea', 'exec-argv'));
// Test that multiple execArgv are properly applied
spawnSyncAndAssert(
outputFile,
['user-arg1', 'user-arg2'],
{
env: {
...process.env,
NODE_NO_WARNINGS: '0',
COMMON_DIRECTORY: join(__dirname, '..', 'common'),
NODE_DEBUG_NATIVE: 'SEA',
},
},
{
stdout: /multiple execArgv test passed/,
stderr(output) {
assert.doesNotMatch(output, /This warning should not be shown in the output/);
return true;
},
trim: true,
});