mirror of https://github.com/lukechilds/node.git
Browse Source
Add test to cover setter for deprecated cluster Worker property. Previously, the setter was not being exercised in tests. PR-URL: https://github.com/nodejs/node/pull/10675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>v6
Rich Trott
8 years ago
2 changed files with 24 additions and 8 deletions
@ -0,0 +1,18 @@ |
|||
'use strict'; |
|||
require('../common'); |
|||
|
|||
const assert = require('assert'); |
|||
const cluster = require('cluster'); |
|||
|
|||
const worker = new cluster.Worker(); |
|||
|
|||
assert.strictEqual(worker.exitedAfterDisconnect, undefined); |
|||
assert.strictEqual(worker.suicide, undefined); |
|||
|
|||
worker.exitedAfterDisconnect = 'recommended'; |
|||
assert.strictEqual(worker.exitedAfterDisconnect, 'recommended'); |
|||
assert.strictEqual(worker.suicide, 'recommended'); |
|||
|
|||
worker.suicide = 'deprecated'; |
|||
assert.strictEqual(worker.exitedAfterDisconnect, 'deprecated'); |
|||
assert.strictEqual(worker.suicide, 'deprecated'); |
Loading…
Reference in new issue