mirror of
https://github.com/nodejs/node.git
synced 2025-04-29 06:19:07 +00:00

PR-URL: https://github.com/nodejs/node/pull/13012 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
18 lines
509 B
JavaScript
18 lines
509 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
const expected = '--option-to-be-seen-on-child';
|
|
|
|
const { spawn } = require('child_process');
|
|
const child = spawn(process.execPath, ['-', expected], { stdio: 'pipe' });
|
|
|
|
child.stdin.end('console.log(process.argv[2])');
|
|
|
|
let actual = '';
|
|
child.stdout.setEncoding('utf8');
|
|
child.stdout.on('data', (chunk) => actual += chunk);
|
|
child.stdout.on('end', common.mustCall(() => {
|
|
assert.strictEqual(actual.trim(), expected);
|
|
}));
|