node/test/parallel/test-cluster-setup-master-argv.js
Gibson Fahnestock 7a0e462f9f test: use eslint to fix var->const/let
Manually fix issues that eslint --fix couldn't do automatically.

PR-URL: https://github.com/nodejs/node/pull/10685
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2017-01-11 11:43:52 +00:00

19 lines
596 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const cluster = require('cluster');
setTimeout(common.fail.bind(assert, 'setup not emitted'), 1000).unref();
cluster.on('setup', common.mustCall(function() {
const clusterArgs = cluster.settings.args;
const realArgs = process.argv;
assert.strictEqual(clusterArgs[clusterArgs.length - 1],
realArgs[realArgs.length - 1]);
}));
assert.notStrictEqual(process.argv[process.argv.length - 1], 'OMG,OMG');
process.argv.push('OMG,OMG');
process.argv.push('OMG,OMG');
cluster.setupMaster();