-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test,cluster: add test-cluster-worker-deprecated
Add test to cover setter for deprecated cluster Worker property. Previously, the setter was not being exercised in tests. PR-URL: #10675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
- Loading branch information
1 parent
cf5579d
commit 4323c80
Showing
2 changed files
with
24 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); |