0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-net-localport.js
Faiz Halde 3ae670275c
test: console.log removed from test-net-localport
There seems to be an unecessary console log
happening in a test.

PR-URL: https://github.com/nodejs/node/pull/12483
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: David Cai <davidcai1993@yahoo.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2017-04-20 05:57:17 +09:00

21 lines
547 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const net = require('net');
const server = net.createServer(function(socket) {
assert.strictEqual(socket.remotePort, common.PORT);
socket.end();
socket.on('close', function() {
server.close();
});
}).listen(0).on('listening', function() {
const client = net.connect({
host: '127.0.0.1',
port: this.address().port,
localPort: common.PORT,
}).on('connect', function() {
assert.strictEqual(client.localPort, common.PORT);
});
});