mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
3ae670275c
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>
21 lines
547 B
JavaScript
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);
|
|
});
|
|
});
|