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>
19 lines
687 B
JavaScript
19 lines
687 B
JavaScript
const assert = require('assert');
|
|
|
|
process.emitWarning('This warning should not be shown in the output', 'TestWarning');
|
|
|
|
console.log('process.argv:', JSON.stringify(process.argv));
|
|
console.log('process.execArgv:', JSON.stringify(process.execArgv));
|
|
|
|
// Should have execArgv from SEA config.
|
|
// Note that flags from NODE_OPTIONS are not included in process.execArgv no matter it's
|
|
// an SEA or not, but we can test whether it works by checking that the warning emitted
|
|
// above was silenced.
|
|
assert.deepStrictEqual(process.execArgv, ['--no-warnings']);
|
|
|
|
assert.deepStrictEqual(process.argv.slice(2), [
|
|
'user-arg1',
|
|
'user-arg2'
|
|
]);
|
|
|
|
console.log('execArgvExtension env test passed');
|