Skip to content

Commit

Permalink
test: swapped == and equal to === and strictEqual
Browse files Browse the repository at this point in the history
Line 21 used '==' for a Number comparison, changed to '===''.
Lines 36 and 46 used 'assert.equal', changed to 'assert.strictEqual'.
Lines 2, 3 and 4 require statements used var, changed to const.

PR-URL: #8472
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
  • Loading branch information
HyperSprite authored and MylesBorins committed Oct 26, 2016
1 parent c6b622f commit 5a07bb6
Showing 1 changed file with 6 additions and 6 deletions.
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 = 0, conns_closed = 0;

Expand All @@ -19,7 +19,7 @@ var server = net.createServer(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 @@ -34,7 +34,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 @@ -44,7 +44,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

0 comments on commit 5a07bb6

Please sign in to comment.