Skip to content

Commit b07aa92

Browse files
sharpstefBridgeAR
authored andcommitted
test: expand error message
PR-URL: #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>
1 parent 932499e commit b07aa92

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

test/parallel/test-cluster-worker-isdead.js

+12-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ const assert = require('assert');
55

66
if (cluster.isMaster) {
77
const worker = cluster.fork();
8-
assert.ok(
9-
!worker.isDead(),
10-
'isDead() should return false right after the worker has been created.');
8+
let workerDead = worker.isDead();
9+
assert.ok(!workerDead,
10+
`isDead() returned ${workerDead}. isDead() should return ` +
11+
'false right after the worker has been created.');
1112

1213
worker.on('exit', function() {
13-
assert.ok(worker.isDead(),
14-
'After an event has been emitted, isDead should return true');
14+
workerDead = worker.isDead();
15+
assert.ok(workerDead,
16+
`isDead() returned ${workerDead}. After an event has been ` +
17+
'emitted, isDead should return true');
1518
});
1619

1720
worker.on('message', function(msg) {
@@ -21,7 +24,9 @@ if (cluster.isMaster) {
2124
});
2225

2326
} else if (cluster.isWorker) {
24-
assert.ok(!cluster.worker.isDead(),
25-
'isDead() should return false when called from within a worker');
27+
const workerDead = cluster.worker.isDead();
28+
assert.ok(!workerDead,
29+
`isDead() returned ${workerDead}. isDead() should return ` +
30+
'false when called from within a worker');
2631
process.send('readyToDie');
2732
}

0 commit comments

Comments
 (0)