From 5a07bb62ea849caa6058371998aaf0a53851f399 Mon Sep 17 00:00:00 2001 From: Christopher Dunavan Date: Fri, 9 Sep 2016 15:28:15 -0700 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/8472 Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Sakthipriyan Vairamani --- test/parallel/test-net-remote-address-port.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-net-remote-address-port.js b/test/parallel/test-net-remote-address-port.js index beb5625ee11858..88b2c6aca32510 100644 --- a/test/parallel/test-net-remote-address-port.js +++ b/test/parallel/test-net-remote-address-port.js @@ -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; @@ -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)); @@ -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() { @@ -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() {