From a08162d860653fd14d270b4b549f1a62b0305d0b Mon Sep 17 00:00:00 2001 From: treysis Date: Sun, 5 Sep 2021 17:25:40 +0200 Subject: [PATCH] dns: fix linter errors PR-URL: https://github.com/nodejs/node/pull/39987 Fixes: https://github.com/nodejs/node/issues/31566 Refs: https://github.com/nodejs/node/issues/6307 Refs: https://github.com/nodejs/node/pull/20710 Refs: https://github.com/nodejs/node/pull/38099 Reviewed-By: Antoine du Hamel Reviewed-By: Matteo Collina Reviewed-By: James M Snell Reviewed-By: Michael Dawson --- test/parallel/test-net-pingpong.js | 2 +- test/parallel/test-net-remote-address-port.js | 6 +++--- test/pummel/test-net-pingpong.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-net-pingpong.js b/test/parallel/test-net-pingpong.js index 29652ec0d1c6ce..3bbe076b4b1658 100644 --- a/test/parallel/test-net-pingpong.js +++ b/test/parallel/test-net-pingpong.js @@ -130,4 +130,4 @@ const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); pingPongTest(common.PIPE); pingPongTest(0); -common.hasIPv6 ? pingPongTest(0, '::1') : pingPongTest(0, '127.0.0.1'); +if (common.hasIPv6) pingPongTest(0, '::1'); else pingPongTest(0, '127.0.0.1'); diff --git a/test/parallel/test-net-remote-address-port.js b/test/parallel/test-net-remote-address-port.js index a3ad67d9f9ec6e..fe090a3aa7a580 100644 --- a/test/parallel/test-net-remote-address-port.js +++ b/test/parallel/test-net-remote-address-port.js @@ -34,10 +34,10 @@ const remoteFamilyCandidates = ['IPv4']; if (common.hasIPv6) remoteFamilyCandidates.push('IPv6'); const server = net.createServer(common.mustCall(function(socket) { - // test to see real value in CI log + // Test to see real value in CI log assert.match(socket.remoteAddress, - /^127\.0\.0\.1$|^::1$|^::ffff:127.0.0.1$/); - // assert.ok(remoteAddrCandidates.includes(socket.remoteAddress)); + /^127\.0\.0\.1$|^::1$|^::ffff:127\.0\.0\.1$/); + // REM: assert.ok(remoteAddrCandidates.includes(socket.remoteAddress)); assert.ok(remoteFamilyCandidates.includes(socket.remoteFamily)); assert.ok(socket.remotePort); assert.notStrictEqual(socket.remotePort, this.address().port); diff --git a/test/pummel/test-net-pingpong.js b/test/pummel/test-net-pingpong.js index 10c7a36fc4afe5..c5ada54fcecd74 100644 --- a/test/pummel/test-net-pingpong.js +++ b/test/pummel/test-net-pingpong.js @@ -112,7 +112,7 @@ function pingPongTest(host, on_complete) { // All are run at once and will run on different ports. pingPongTest(null); -common.hasIPv6 ? pingPongTest('::1') : pingPongTest('127.0.0.1'); +if (common.hasIPv6) pingPongTest('::1'); else pingPongTest('127.0.0.1'); process.on('exit', function() { assert.strictEqual(tests_run, common.hasIPv6 ? 3 : 2);