You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
649 B

'use strict';
const common = require('../common');
const assert = require('assert');
const cluster = require('cluster');
assert(cluster.isMaster);
function emitAndCatch(next) {
cluster.once('setup', common.mustCall(function(settings) {
assert.strictEqual(settings.exec, 'new-exec');
setImmediate(next);
}));
cluster.setupMaster({ exec: 'new-exec' });
}
function emitAndCatch2(next) {
cluster.once('setup', common.mustCall(function(settings) {
assert('exec' in settings);
setImmediate(next);
}));
cluster.setupMaster();
}
emitAndCatch(common.mustCall(function() {
emitAndCatch2(common.mustCall(function() {}));
}));