Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: stricter comparisons for equal and require var to const #8472

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions test/parallel/test-net-remote-address-port.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';
var common = require('../common');
var assert = require('assert');
const common = require('../common');
const assert = require('assert');

var net = require('net');
const net = require('net');

var conns_closed = 0;

Expand All @@ -18,7 +18,7 @@ var server = net.createServer(common.mustCall(function(socket) {
assert.ok(socket.remotePort);
assert.notEqual(socket.remotePort, this.address().port);
socket.on('end', function() {
if (++conns_closed == 2) server.close();
if (++conns_closed === 2) server.close();
});
socket.on('close', function() {
assert.notEqual(-1, remoteAddrCandidates.indexOf(socket.remoteAddress));
Expand All @@ -33,7 +33,7 @@ server.listen(0, 'localhost', function() {
client.on('connect', function() {
assert.notEqual(-1, remoteAddrCandidates.indexOf(client.remoteAddress));
assert.notEqual(-1, remoteFamilyCandidates.indexOf(client.remoteFamily));
assert.equal(client.remotePort, server.address().port);
assert.strictEqual(client.remotePort, server.address().port);
client.end();
});
client.on('close', function() {
Expand All @@ -43,7 +43,7 @@ server.listen(0, 'localhost', function() {
client2.on('connect', function() {
assert.notEqual(-1, remoteAddrCandidates.indexOf(client2.remoteAddress));
assert.notEqual(-1, remoteFamilyCandidates.indexOf(client2.remoteFamily));
assert.equal(client2.remotePort, server.address().port);
assert.strictEqual(client2.remotePort, server.address().port);
client2.end();
});
client2.on('close', function() {
Expand Down