Skip to content

Commit 5a07bb6

Browse files
HyperSpriteMylesBorins
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent c6b622f commit 5a07bb6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

+6-6
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 = 0, conns_closed = 0;
88

@@ -19,7 +19,7 @@ var server = net.createServer(function(socket) {
1919
assert.ok(socket.remotePort);
2020
assert.notEqual(socket.remotePort, this.address().port);
2121
socket.on('end', function() {
22-
if (++conns_closed == 2) server.close();
22+
if (++conns_closed === 2) server.close();
2323
});
2424
socket.on('close', function() {
2525
assert.notEqual(-1, remoteAddrCandidates.indexOf(socket.remoteAddress));
@@ -34,7 +34,7 @@ server.listen(0, 'localhost', function() {
3434
client.on('connect', function() {
3535
assert.notEqual(-1, remoteAddrCandidates.indexOf(client.remoteAddress));
3636
assert.notEqual(-1, remoteFamilyCandidates.indexOf(client.remoteFamily));
37-
assert.equal(client.remotePort, server.address().port);
37+
assert.strictEqual(client.remotePort, server.address().port);
3838
client.end();
3939
});
4040
client.on('close', function() {
@@ -44,7 +44,7 @@ server.listen(0, 'localhost', function() {
4444
client2.on('connect', function() {
4545
assert.notEqual(-1, remoteAddrCandidates.indexOf(client2.remoteAddress));
4646
assert.notEqual(-1, remoteFamilyCandidates.indexOf(client2.remoteFamily));
47-
assert.equal(client2.remotePort, server.address().port);
47+
assert.strictEqual(client2.remotePort, server.address().port);
4848
client2.end();
4949
});
5050
client2.on('close', function() {

0 commit comments

Comments
 (0)