test: refactor test-cluster-setup-master-argv
- updated vars to const - add common.mustCall() to setup callback PR-URL: https://github.com/nodejs/node/pull/9960 Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
3f1973372b
commit
33435d5947
@ -1,16 +1,16 @@
|
||||
'use strict';
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
var cluster = require('cluster');
|
||||
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', function() {
|
||||
cluster.on('setup', common.mustCall(function() {
|
||||
var clusterArgs = cluster.settings.args;
|
||||
var 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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user