From 231f0ee9b215fbcc80d5a0eb49c1b5d4623d68d5 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 1 Feb 2023 10:46:06 +0100 Subject: [PATCH] test: add trailing commas in `test/internet` PR-URL: https://github.com/nodejs/node/pull/46407 Reviewed-By: Moshe Atlow Reviewed-By: Gireesh Punathil --- test/.eslintrc.yaml | 1 - test/internet/test-corepack-yarn-install.js | 8 ++++---- .../test-dgram-broadcast-multi-process.js | 6 +++--- test/internet/test-dgram-membership.js | 2 +- .../test-dgram-multicast-multi-process.js | 4 ++-- .../test-dgram-multicast-set-interface-lo.js | 8 ++++---- .../test-dgram-multicast-ssm-multi-process.js | 4 ++-- ...est-dgram-multicast-ssmv6-multi-process.js | 4 ++-- test/internet/test-dns-any.js | 2 +- test/internet/test-dns-idna2008.js | 2 +- test/internet/test-dns-ipv4.js | 12 +++++------ test/internet/test-dns-ipv6.js | 10 +++++----- test/internet/test-dns-lookup.js | 20 +++++++++---------- test/internet/test-dns-promises-resolve.js | 8 ++++---- test/internet/test-dns.js | 16 +++++++-------- test/internet/test-http-dns-fail.js | 2 +- test/internet/test-tls-add-ca-cert.js | 2 +- test/internet/test-trace-events-dns.js | 2 +- 18 files changed, 56 insertions(+), 57 deletions(-) diff --git a/test/.eslintrc.yaml b/test/.eslintrc.yaml index 42f705f9796de8..1dec01334719d5 100644 --- a/test/.eslintrc.yaml +++ b/test/.eslintrc.yaml @@ -74,7 +74,6 @@ overrides: - files: - es-module/*.js - es-module/*.mjs - - internet/*.js - js-native-api/*/*.js - known_issues/*.js - parallel/*.js diff --git a/test/internet/test-corepack-yarn-install.js b/test/internet/test-corepack-yarn-install.js index 476f6eea2077f0..48a9bdb44cd75f 100644 --- a/test/internet/test-corepack-yarn-install.js +++ b/test/internet/test-corepack-yarn-install.js @@ -25,13 +25,13 @@ const corepackYarnPath = path.join( 'deps', 'corepack', 'dist', - 'yarn.js' + 'yarn.js', ); const pkgContent = JSON.stringify({ dependencies: { - 'package-name': fixtures.path('packages/main') - } + 'package-name': fixtures.path('packages/main'), + }, }); const pkgPath = path.join(installDir, 'package.json'); @@ -46,7 +46,7 @@ const env = { ...process.env, exec(`${process.execPath} ${corepackYarnPath} install`, { cwd: installDir, - env: env + env: env, }, common.mustCall(handleExit)); function handleExit(error, stdout, stderr) { diff --git a/test/internet/test-dgram-broadcast-multi-process.js b/test/internet/test-dgram-broadcast-multi-process.js index 5972c5e24e537c..a71b01aac5df84 100644 --- a/test/internet/test-dgram-broadcast-multi-process.js +++ b/test/internet/test-dgram-broadcast-multi-process.js @@ -166,7 +166,7 @@ if (process.argv[2] !== 'child') { const sendSocket = dgram.createSocket({ type: 'udp4', - reuseAddr: true + reuseAddr: true, }); // Bind the address explicitly for sending @@ -203,7 +203,7 @@ if (process.argv[2] !== 'child') { LOCAL_BROADCAST_HOST, common.PORT); process.nextTick(sendSocket.sendNext); - } + }, ); }; @@ -219,7 +219,7 @@ if (process.argv[2] === 'child') { const receivedMessages = []; const listenSocket = dgram.createSocket({ type: 'udp4', - reuseAddr: true + reuseAddr: true, }); listenSocket.on('message', (buf, rinfo) => { diff --git a/test/internet/test-dgram-membership.js b/test/internet/test-dgram-membership.js index d4bad5c2daa08c..04005428874a0e 100644 --- a/test/internet/test-dgram-membership.js +++ b/test/internet/test-dgram-membership.js @@ -19,7 +19,7 @@ const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); const socket = setup(); assert.throws( () => { socket.dropMembership(multicastAddress); }, - /^Error: dropMembership EADDRNOTAVAIL$/ + /^Error: dropMembership EADDRNOTAVAIL$/, ); socket.close(); } diff --git a/test/internet/test-dgram-multicast-multi-process.js b/test/internet/test-dgram-multicast-multi-process.js index 6127748368c097..fe9c2cb02e772a 100644 --- a/test/internet/test-dgram-multicast-multi-process.js +++ b/test/internet/test-dgram-multicast-multi-process.js @@ -188,7 +188,7 @@ if (process.argv[2] !== 'child') { buf.toString(), LOCAL_BROADCAST_HOST, common.PORT); process.nextTick(sendSocket.sendNext); - } + }, ); }; } @@ -197,7 +197,7 @@ if (process.argv[2] === 'child') { const receivedMessages = []; const listenSocket = dgram.createSocket({ type: 'udp4', - reuseAddr: true + reuseAddr: true, }); listenSocket.on('listening', function() { diff --git a/test/internet/test-dgram-multicast-set-interface-lo.js b/test/internet/test-dgram-multicast-set-interface-lo.js index 11c3d47cff0637..b33a6922c181ad 100644 --- a/test/internet/test-dgram-multicast-set-interface-lo.js +++ b/test/internet/test-dgram-multicast-set-interface-lo.js @@ -25,7 +25,7 @@ const networkInterfaces = require('os').networkInterfaces(); const fork = require('child_process').fork; const MULTICASTS = { IPv4: ['224.0.0.115', '224.0.0.116', '224.0.0.117'], - IPv6: ['ff02::1:115', 'ff02::1:116', 'ff02::1:117'] + IPv6: ['ff02::1:115', 'ff02::1:116', 'ff02::1:117'], }; const LOOPBACK = { IPv4: '127.0.0.1', IPv6: '::1' }; const ANY = { IPv4: '0.0.0.0', IPv6: '::' }; @@ -201,7 +201,7 @@ if (process.argv[2] !== 'child') { const sendSocket = dgram.createSocket({ type: UDP[FAM], - reuseAddr: true + reuseAddr: true, }); // Don't bind the address explicitly when sending and start with @@ -241,7 +241,7 @@ if (process.argv[2] !== 'child') { msg.mcast, PORTS[msg.mcast]); process.nextTick(sendSocket.sendNext); - } + }, ); }; } @@ -256,7 +256,7 @@ if (process.argv[2] === 'child') { console.error(`pid ${process.pid} iface ${IFACE} MULTICAST ${MULTICAST}`); const listenSocket = dgram.createSocket({ type: UDP[FAM], - reuseAddr: true + reuseAddr: true, }); listenSocket.on('message', (buf, rinfo) => { diff --git a/test/internet/test-dgram-multicast-ssm-multi-process.js b/test/internet/test-dgram-multicast-ssm-multi-process.js index 324c989a180fa0..693d717a0d237e 100644 --- a/test/internet/test-dgram-multicast-ssm-multi-process.js +++ b/test/internet/test-dgram-multicast-ssm-multi-process.js @@ -182,7 +182,7 @@ if (process.argv[2] !== 'child') { buf.toString(), GROUP_ADDRESS, common.PORT); process.nextTick(sendSocket.sendNext); - } + }, ); }; } @@ -191,7 +191,7 @@ if (process.argv[2] === 'child') { const receivedMessages = []; const listenSocket = dgram.createSocket({ type: 'udp4', - reuseAddr: true + reuseAddr: true, }); listenSocket.on('listening', function() { diff --git a/test/internet/test-dgram-multicast-ssmv6-multi-process.js b/test/internet/test-dgram-multicast-ssmv6-multi-process.js index fd7b8dcd4ce011..c8ecafdca910dc 100644 --- a/test/internet/test-dgram-multicast-ssmv6-multi-process.js +++ b/test/internet/test-dgram-multicast-ssmv6-multi-process.js @@ -182,7 +182,7 @@ if (process.argv[2] !== 'child') { buf.toString(), GROUP_ADDRESS, common.PORT); process.nextTick(sendSocket.sendNext); - } + }, ); }; } @@ -191,7 +191,7 @@ if (process.argv[2] === 'child') { const receivedMessages = []; const listenSocket = dgram.createSocket({ type: 'udp6', - reuseAddr: true + reuseAddr: true, }); listenSocket.on('listening', function() { diff --git a/test/internet/test-dns-any.js b/test/internet/test-dns-any.js index 33556322a8d350..b3d087ca721aad 100644 --- a/test/internet/test-dns-any.js +++ b/test/internet/test-dns-any.js @@ -78,7 +78,7 @@ const checkers = { assert.strictEqual(typeof r.priority, 'number'); assert.strictEqual(typeof r.weight, 'number'); assert.strictEqual(r.type, 'SRV'); - } + }, }; function TEST(f) { diff --git a/test/internet/test-dns-idna2008.js b/test/internet/test-dns-idna2008.js index 88c156303a06a0..16c8933073139a 100644 --- a/test/internet/test-dns-idna2008.js +++ b/test/internet/test-dns-idna2008.js @@ -34,7 +34,7 @@ dns.lookup( } assert.ifError(err); assert.strictEqual(address, fixture.expectedAddress); - }) + }), ); dns.promises.lookup(fixture.hostname, { family: fixture.family }) diff --git a/test/internet/test-dns-ipv4.js b/test/internet/test-dns-ipv4.js index b673e2f920d0d4..0d674e8390b163 100644 --- a/test/internet/test-dns-ipv4.js +++ b/test/internet/test-dns-ipv4.js @@ -127,7 +127,7 @@ TEST(async function test_lookup_ipv4_explicit_object(done) { validateResult(await dnsPromises.lookup(addresses.INET4_HOST, { family: 4 })); const req = dns.lookup(addresses.INET4_HOST, { - family: 4 + family: 4, }, common.mustSucceed((ip, family) => { validateResult({ address: ip, family }); done(); @@ -143,11 +143,11 @@ TEST(async function test_lookup_ipv4_hint_addrconfig(done) { } validateResult(await dnsPromises.lookup(addresses.INET4_HOST, { - hints: dns.ADDRCONFIG + hints: dns.ADDRCONFIG, })); const req = dns.lookup(addresses.INET4_HOST, { - hints: dns.ADDRCONFIG + hints: dns.ADDRCONFIG, }, common.mustSucceed((ip, family) => { validateResult({ address: ip, family }); done(); @@ -203,7 +203,7 @@ TEST(async function test_lookup_all_ipv4(done) { validateResult(await dnsPromises.lookup(addresses.INET4_HOST, { all: true, - family: 4 + family: 4, })); const req = dns.lookup( @@ -212,7 +212,7 @@ TEST(async function test_lookup_all_ipv4(done) { common.mustSucceed((ips) => { validateResult(ips); done(); - }) + }), ); checkWrap(req); @@ -232,7 +232,7 @@ TEST(async function test_lookupservice_ip_ipv4(done) { common.mustSucceed((hostname, service) => { validateResult({ hostname, service }); done(); - }) + }), ); checkWrap(req); diff --git a/test/internet/test-dns-ipv6.js b/test/internet/test-dns-ipv6.js index 7d2c18985e2167..b1c8a095c0b991 100644 --- a/test/internet/test-dns-ipv6.js +++ b/test/internet/test-dns-ipv6.js @@ -122,7 +122,7 @@ TEST(async function test_lookup_ipv6_explicit_object(done) { validateResult(await dnsPromises.lookup(addresses.INET6_HOST, { family: 6 })); const req = dns.lookup(addresses.INET6_HOST, { - family: 6 + family: 6, }, common.mustSucceed((ip, family) => { validateResult({ address: ip, family }); done(); @@ -134,7 +134,7 @@ TEST(async function test_lookup_ipv6_explicit_object(done) { TEST(function test_lookup_ipv6_hint(done) { const req = dns.lookup(addresses.INET6_HOST, { family: 6, - hints: dns.V4MAPPED + hints: dns.V4MAPPED, }, common.mustCall((err, ip, family) => { if (err) { // FreeBSD does not support V4MAPPED @@ -191,7 +191,7 @@ TEST(async function test_lookup_all_ipv6(done) { validateResult(await dnsPromises.lookup(addresses.INET6_HOST, { all: true, - family: 6 + family: 6, })); const req = dns.lookup( @@ -200,7 +200,7 @@ TEST(async function test_lookup_all_ipv6(done) { common.mustSucceed((ips) => { validateResult(ips); done(); - }) + }), ); checkWrap(req); @@ -220,7 +220,7 @@ TEST(function test_lookupservice_ip_ipv6(done) { assert(host); assert(['http', 'www', '80'].includes(service)); done(); - }) + }), ); checkWrap(req); diff --git a/test/internet/test-dns-lookup.js b/test/internet/test-dns-lookup.js index 6e2714ecad07d0..6b06801dd1afb8 100644 --- a/test/internet/test-dns-lookup.js +++ b/test/internet/test-dns-lookup.js @@ -11,35 +11,35 @@ assert.rejects( dnsPromises.lookup(addresses.NOT_FOUND, { hints: 0, family: 0, - all: false + all: false, }), { code: 'ENOTFOUND', - message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}` - } + message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`, + }, ); assert.rejects( dnsPromises.lookup(addresses.NOT_FOUND, { hints: 0, family: 0, - all: true + all: true, }), { code: 'ENOTFOUND', - message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}` - } + message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`, + }, ); dns.lookup(addresses.NOT_FOUND, { hints: 0, family: 0, - all: true + all: true, }, common.mustCall((error) => { assert.strictEqual(error.code, 'ENOTFOUND'); assert.strictEqual( error.message, - `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}` + `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`, ); assert.strictEqual(error.syscall, 'getaddrinfo'); assert.strictEqual(error.hostname, addresses.NOT_FOUND); @@ -48,7 +48,7 @@ dns.lookup(addresses.NOT_FOUND, { assert.throws( () => dnsPromises.lookup(addresses.NOT_FOUND, { family: 'ipv4', - all: 'all' + all: 'all', }), - { code: 'ERR_INVALID_ARG_VALUE' } + { code: 'ERR_INVALID_ARG_VALUE' }, ); diff --git a/test/internet/test-dns-promises-resolve.js b/test/internet/test-dns-promises-resolve.js index d9607a44f60e31..620ae290308380 100644 --- a/test/internet/test-dns-promises-resolve.js +++ b/test/internet/test-dns-promises-resolve.js @@ -12,8 +12,8 @@ const dnsPromises = require('dns').promises; { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError', - message: `The argument 'rrtype' is invalid. Received '${rrtype}'` - } + message: `The argument 'rrtype' is invalid. Received '${rrtype}'`, + }, ); } @@ -26,8 +26,8 @@ const dnsPromises = require('dns').promises; code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "rrtype" argument must be of type string. ' + - `Received type ${typeof rrtype} (${rrtype})` - } + `Received type ${typeof rrtype} (${rrtype})`, + }, ); } diff --git a/test/internet/test-dns.js b/test/internet/test-dns.js index 0cc56d1a72137f..090a376e8b2463 100644 --- a/test/internet/test-dns.js +++ b/test/internet/test-dns.js @@ -97,11 +97,11 @@ TEST(async function test_resolve4_ttl(done) { } validateResult(await dnsPromises.resolve4(addresses.INET4_HOST, { - ttl: true + ttl: true, })); const req = dns.resolve4(addresses.INET4_HOST, { - ttl: true + ttl: true, }, function(err, result) { assert.ifError(err); validateResult(result); @@ -125,11 +125,11 @@ TEST(async function test_resolve6_ttl(done) { } validateResult(await dnsPromises.resolve6(addresses.INET6_HOST, { - ttl: true + ttl: true, })); const req = dns.resolve6(addresses.INET6_HOST, { - ttl: true + ttl: true, }, function(err, result) { assert.ifError(err); validateResult(result); @@ -555,7 +555,7 @@ TEST(async function test_lookup_ip_all(done) { assert.strictEqual(family, undefined); validateResult(ips); done(); - } + }, ); checkWrap(req); @@ -621,7 +621,7 @@ TEST(async function test_lookup_all_mixed(done) { validateResult(await dnsPromises.lookup(addresses.INET_HOST, { all: true })); const req = dns.lookup(addresses.INET_HOST, { - all: true + all: true, }, function(err, ips) { assert.ifError(err); validateResult(ips); @@ -654,7 +654,7 @@ TEST(function test_reverse_failure(done) { .then(common.mustNotCall()) .catch(common.expectsError({ code: 'ENOTFOUND', - hostname: '203.0.113.0' + hostname: '203.0.113.0', })); // 203.0.113.0/24 are addresses reserved for (RFC) documentation use only @@ -676,7 +676,7 @@ TEST(function test_lookup_failure(done) { .then(common.mustNotCall()) .catch(common.expectsError({ code: 'ENOTFOUND', - hostname: addresses.NOT_FOUND + hostname: addresses.NOT_FOUND, })); const req = dns.lookup(addresses.NOT_FOUND, (err) => { diff --git a/test/internet/test-http-dns-fail.js b/test/internet/test-http-dns-fail.js index 00875a976335e6..5aacd53f8a42c3 100644 --- a/test/internet/test-http-dns-fail.js +++ b/test/internet/test-http-dns-fail.js @@ -35,7 +35,7 @@ function httpreq(count) { host: 'not-a-real-domain-name.nobody-would-register-this-as-a-tld', port: 80, path: '/', - method: 'GET' + method: 'GET', }, common.mustNotCall()); req.on('error', common.mustCall((e) => { diff --git a/test/internet/test-tls-add-ca-cert.js b/test/internet/test-tls-add-ca-cert.js index c3780acd50671a..2515758ec86c1a 100644 --- a/test/internet/test-tls-add-ca-cert.js +++ b/test/internet/test-tls-add-ca-cert.js @@ -24,7 +24,7 @@ const caCert = loadPEM('ca1-cert'); const opts = { host: 'www.nodejs.org', port: 443, - rejectUnauthorized: true + rejectUnauthorized: true, }; // Success relies on the compiled in well-known root CAs diff --git a/test/internet/test-trace-events-dns.js b/test/internet/test-trace-events-dns.js index 529665f907b0c9..64efd541fd9d2c 100644 --- a/test/internet/test-trace-events-dns.js +++ b/test/internet/test-trace-events-dns.js @@ -37,7 +37,7 @@ const tests = { 'resolveSrv': 'dns.resolveSrv("example.com", (err, res) => {});', 'resolvePtr': 'dns.resolvePtr("example.com", (err, res) => {});', 'resolveNaptr': 'dns.resolveNaptr("example.com", (err, res) => {});', - 'resolveSoa': 'dns.resolveSoa("example.com", (err, res) => {});' + 'resolveSoa': 'dns.resolveSoa("example.com", (err, res) => {});', }; for (const tr in tests) {