mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 23:10:15 +00:00

There were no tests confirming situations where server.connections should return `null`. Add a test for that situation. Expand existing server.connection test slightly to check value. Refactor (mostly spacing) code for server.connections setter. PR-URL: https://github.com/nodejs/node/pull/10762 Reviewed-By: James M Snell <jasnell@gmail.com>
19 lines
575 B
JavaScript
19 lines
575 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
const net = require('net');
|
|
|
|
const server = new net.Server();
|
|
|
|
const expectedWarning = 'Server.connections property is deprecated. ' +
|
|
'Use Server.getConnections method instead.';
|
|
|
|
common.expectWarning('DeprecationWarning', expectedWarning);
|
|
|
|
// test that server.connections property is no longer enumerable now that it
|
|
// has been marked as deprecated
|
|
assert.strictEqual(Object.keys(server).indexOf('connections'), -1);
|
|
|
|
assert.strictEqual(server.connections, 0);
|