Skip to content

Commit

Permalink
cluster: add test for worker
Browse files Browse the repository at this point in the history
Add test for work in addition to tests for master
  • Loading branch information
stv8 committed Dec 15, 2016
1 parent a0af33c commit 14f58fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/parallel/test-cluster-worker-destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

const common = require('../common');
const assert = require('assert');
var cluster = require('cluster');
var worker1, worker2;

Expand All @@ -26,7 +27,8 @@ if (cluster.isMaster) {
cluster.worker.destroy();
});

cluster.worker.disconnect();
const w = cluster.worker.disconnect();
assert.strictEqual(w, cluster.worker, 'did not return a reference');
} else {
// Call destroy when worker is not disconnected yet
cluster.worker.destroy();
Expand Down

0 comments on commit 14f58fd

Please sign in to comment.