node/test/parallel/test-child-process-fork-no-shell.js
Fran Herrero c52ebc06da
test: use spread object
Object.assign() can be replaced by spread objects

PR-URL: https://github.com/nodejs/node/pull/30423
Refs: https://eslint.org/docs/rules/prefer-object-spread
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-03 01:44:54 +01:00

21 lines
593 B
JavaScript

'use strict';
// This test verifies that the shell option is not supported by fork().
const common = require('../common');
const assert = require('assert');
const cp = require('child_process');
const expected = common.isWindows ? '%foo%' : '$foo';
if (process.argv[2] === undefined) {
const child = cp.fork(__filename, [expected], {
shell: true,
env: { ...process.env, foo: 'bar' }
});
child.on('exit', common.mustCall((code, signal) => {
assert.strictEqual(code, 0);
assert.strictEqual(signal, null);
}));
} else {
assert.strictEqual(process.argv[2], expected);
}