diff options
author | Stefania Sharp <stefaniasharp@gmail.com> | 2017-10-06 21:09:42 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2017-10-24 00:17:32 +0300 |
commit | 0ef63352b3d291da6786edf1f3fda8f58efd539a (patch) | |
tree | 6b553d87b3ace5869b4efb31f651827283988f3d /test | |
parent | 489168d87f686ca0ea59b160eb2827f6684426b4 (diff) |
test: expand error message
PR-URL: https://github.com/nodejs/node/pull/15991
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-cluster-worker-isdead.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/test/parallel/test-cluster-worker-isdead.js b/test/parallel/test-cluster-worker-isdead.js index 4850f6eae96..15567b929a5 100644 --- a/test/parallel/test-cluster-worker-isdead.js +++ b/test/parallel/test-cluster-worker-isdead.js @@ -5,13 +5,16 @@ const assert = require('assert'); if (cluster.isMaster) { const worker = cluster.fork(); - assert.ok( - !worker.isDead(), - 'isDead() should return false right after the worker has been created.'); + let workerDead = worker.isDead(); + assert.ok(!workerDead, + `isDead() returned ${workerDead}. isDead() should return ` + + 'false right after the worker has been created.'); worker.on('exit', function() { - assert.ok(worker.isDead(), - 'After an event has been emitted, isDead should return true'); + workerDead = worker.isDead(); + assert.ok(workerDead, + `isDead() returned ${workerDead}. After an event has been ` + + 'emitted, isDead should return true'); }); worker.on('message', function(msg) { @@ -21,7 +24,9 @@ if (cluster.isMaster) { }); } else if (cluster.isWorker) { - assert.ok(!cluster.worker.isDead(), - 'isDead() should return false when called from within a worker'); + const workerDead = cluster.worker.isDead(); + assert.ok(!workerDead, + `isDead() returned ${workerDead}. isDead() should return ` + + 'false when called from within a worker'); process.send('readyToDie'); } |