Skip to content

Commit

Permalink
test: refactor test-cluster-setup-master-argv
Browse files Browse the repository at this point in the history
- updated vars to const
- add common.mustCall() to setup callback

PR-URL: #9960
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
Oscar Martinez authored and MylesBorins committed Dec 20, 2016
1 parent 384c954 commit a486f6b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-cluster-setup-master-argv.js
Original file line number Diff line number Diff line change
@@ -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(process.argv[process.argv.length - 1] !== 'OMG,OMG');
process.argv.push('OMG,OMG');
Expand Down

0 comments on commit a486f6b

Please sign in to comment.