Skip to content

Commit 1a30fe5

Browse files
HyperSpriteFishrock123
authored andcommitted
test: swapped == and equal to === and strictEqual
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>
1 parent d2b6b66 commit 1a30fe5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/parallel/test-net-remote-address-port.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
2+
const common = require('../common');
3+
const assert = require('assert');
44

5-
var net = require('net');
5+
const net = require('net');
66

77
var conns_closed = 0;
88

@@ -18,7 +18,7 @@ var server = net.createServer(common.mustCall(function(socket) {
1818
assert.ok(socket.remotePort);
1919
assert.notEqual(socket.remotePort, this.address().port);
2020
socket.on('end', function() {
21-
if (++conns_closed == 2) server.close();
21+
if (++conns_closed === 2) server.close();
2222
});
2323
socket.on('close', function() {
2424
assert.notEqual(-1, remoteAddrCandidates.indexOf(socket.remoteAddress));
@@ -33,7 +33,7 @@ server.listen(0, 'localhost', function() {
3333
client.on('connect', function() {
3434
assert.notEqual(-1, remoteAddrCandidates.indexOf(client.remoteAddress));
3535
assert.notEqual(-1, remoteFamilyCandidates.indexOf(client.remoteFamily));
36-
assert.equal(client.remotePort, server.address().port);
36+
assert.strictEqual(client.remotePort, server.address().port);
3737
client.end();
3838
});
3939
client.on('close', function() {
@@ -43,7 +43,7 @@ server.listen(0, 'localhost', function() {
4343
client2.on('connect', function() {
4444
assert.notEqual(-1, remoteAddrCandidates.indexOf(client2.remoteAddress));
4545
assert.notEqual(-1, remoteFamilyCandidates.indexOf(client2.remoteFamily));
46-
assert.equal(client2.remotePort, server.address().port);
46+
assert.strictEqual(client2.remotePort, server.address().port);
4747
client2.end();
4848
});
4949
client2.on('close', function() {

0 commit comments

Comments
 (0)