0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
nodejs/test/parallel/test-child-process-fork-exec-argv.js
Ali Ijaz Sheikh 9940766f8a
test: fix tests after V8 upgrade
* Changes to messages.
* V8 enabled proxy support by default. The --harmony_proxies flag is
  now gone.

PR-URL: https://github.com/nodejs/node/pull/6482
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2016-06-29 10:44:25 +02:00

29 lines
717 B
JavaScript

'use strict';
require('../common');
var assert = require('assert');
var child_process = require('child_process');
var spawn = child_process.spawn;
var fork = child_process.fork;
if (process.argv[2] === 'fork') {
process.stdout.write(JSON.stringify(process.execArgv), function() {
process.exit();
});
} else if (process.argv[2] === 'child') {
fork(__filename, ['fork']);
} else {
var execArgv = ['--stack-size=256'];
var args = [__filename, 'child', 'arg0'];
var child = spawn(process.execPath, execArgv.concat(args));
var out = '';
child.stdout.on('data', function(chunk) {
out += chunk;
});
child.on('exit', function() {
assert.deepStrictEqual(JSON.parse(out), execArgv);
});
}