Skip to content

Commit 231f0ee

Browse files
aduh95danielleadams
authored andcommitted
test: add trailing commas in test/internet
PR-URL: #46407 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
1 parent a918ac8 commit 231f0ee

18 files changed

+56
-57
lines changed

test/.eslintrc.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ overrides:
7474
- files:
7575
- es-module/*.js
7676
- es-module/*.mjs
77-
- internet/*.js
7877
- js-native-api/*/*.js
7978
- known_issues/*.js
8079
- parallel/*.js

test/internet/test-corepack-yarn-install.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ const corepackYarnPath = path.join(
2525
'deps',
2626
'corepack',
2727
'dist',
28-
'yarn.js'
28+
'yarn.js',
2929
);
3030

3131
const pkgContent = JSON.stringify({
3232
dependencies: {
33-
'package-name': fixtures.path('packages/main')
34-
}
33+
'package-name': fixtures.path('packages/main'),
34+
},
3535
});
3636

3737
const pkgPath = path.join(installDir, 'package.json');
@@ -46,7 +46,7 @@ const env = { ...process.env,
4646

4747
exec(`${process.execPath} ${corepackYarnPath} install`, {
4848
cwd: installDir,
49-
env: env
49+
env: env,
5050
}, common.mustCall(handleExit));
5151

5252
function handleExit(error, stdout, stderr) {

test/internet/test-dgram-broadcast-multi-process.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ if (process.argv[2] !== 'child') {
166166

167167
const sendSocket = dgram.createSocket({
168168
type: 'udp4',
169-
reuseAddr: true
169+
reuseAddr: true,
170170
});
171171

172172
// Bind the address explicitly for sending
@@ -203,7 +203,7 @@ if (process.argv[2] !== 'child') {
203203
LOCAL_BROADCAST_HOST, common.PORT);
204204

205205
process.nextTick(sendSocket.sendNext);
206-
}
206+
},
207207
);
208208
};
209209

@@ -219,7 +219,7 @@ if (process.argv[2] === 'child') {
219219
const receivedMessages = [];
220220
const listenSocket = dgram.createSocket({
221221
type: 'udp4',
222-
reuseAddr: true
222+
reuseAddr: true,
223223
});
224224

225225
listenSocket.on('message', (buf, rinfo) => {

test/internet/test-dgram-membership.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true });
1919
const socket = setup();
2020
assert.throws(
2121
() => { socket.dropMembership(multicastAddress); },
22-
/^Error: dropMembership EADDRNOTAVAIL$/
22+
/^Error: dropMembership EADDRNOTAVAIL$/,
2323
);
2424
socket.close();
2525
}

test/internet/test-dgram-multicast-multi-process.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ if (process.argv[2] !== 'child') {
188188
buf.toString(),
189189
LOCAL_BROADCAST_HOST, common.PORT);
190190
process.nextTick(sendSocket.sendNext);
191-
}
191+
},
192192
);
193193
};
194194
}
@@ -197,7 +197,7 @@ if (process.argv[2] === 'child') {
197197
const receivedMessages = [];
198198
const listenSocket = dgram.createSocket({
199199
type: 'udp4',
200-
reuseAddr: true
200+
reuseAddr: true,
201201
});
202202

203203
listenSocket.on('listening', function() {

test/internet/test-dgram-multicast-set-interface-lo.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const networkInterfaces = require('os').networkInterfaces();
2525
const fork = require('child_process').fork;
2626
const MULTICASTS = {
2727
IPv4: ['224.0.0.115', '224.0.0.116', '224.0.0.117'],
28-
IPv6: ['ff02::1:115', 'ff02::1:116', 'ff02::1:117']
28+
IPv6: ['ff02::1:115', 'ff02::1:116', 'ff02::1:117'],
2929
};
3030
const LOOPBACK = { IPv4: '127.0.0.1', IPv6: '::1' };
3131
const ANY = { IPv4: '0.0.0.0', IPv6: '::' };
@@ -201,7 +201,7 @@ if (process.argv[2] !== 'child') {
201201

202202
const sendSocket = dgram.createSocket({
203203
type: UDP[FAM],
204-
reuseAddr: true
204+
reuseAddr: true,
205205
});
206206

207207
// Don't bind the address explicitly when sending and start with
@@ -241,7 +241,7 @@ if (process.argv[2] !== 'child') {
241241
msg.mcast, PORTS[msg.mcast]);
242242

243243
process.nextTick(sendSocket.sendNext);
244-
}
244+
},
245245
);
246246
};
247247
}
@@ -256,7 +256,7 @@ if (process.argv[2] === 'child') {
256256
console.error(`pid ${process.pid} iface ${IFACE} MULTICAST ${MULTICAST}`);
257257
const listenSocket = dgram.createSocket({
258258
type: UDP[FAM],
259-
reuseAddr: true
259+
reuseAddr: true,
260260
});
261261

262262
listenSocket.on('message', (buf, rinfo) => {

test/internet/test-dgram-multicast-ssm-multi-process.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ if (process.argv[2] !== 'child') {
182182
buf.toString(),
183183
GROUP_ADDRESS, common.PORT);
184184
process.nextTick(sendSocket.sendNext);
185-
}
185+
},
186186
);
187187
};
188188
}
@@ -191,7 +191,7 @@ if (process.argv[2] === 'child') {
191191
const receivedMessages = [];
192192
const listenSocket = dgram.createSocket({
193193
type: 'udp4',
194-
reuseAddr: true
194+
reuseAddr: true,
195195
});
196196

197197
listenSocket.on('listening', function() {

test/internet/test-dgram-multicast-ssmv6-multi-process.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ if (process.argv[2] !== 'child') {
182182
buf.toString(),
183183
GROUP_ADDRESS, common.PORT);
184184
process.nextTick(sendSocket.sendNext);
185-
}
185+
},
186186
);
187187
};
188188
}
@@ -191,7 +191,7 @@ if (process.argv[2] === 'child') {
191191
const receivedMessages = [];
192192
const listenSocket = dgram.createSocket({
193193
type: 'udp6',
194-
reuseAddr: true
194+
reuseAddr: true,
195195
});
196196

197197
listenSocket.on('listening', function() {

test/internet/test-dns-any.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const checkers = {
7878
assert.strictEqual(typeof r.priority, 'number');
7979
assert.strictEqual(typeof r.weight, 'number');
8080
assert.strictEqual(r.type, 'SRV');
81-
}
81+
},
8282
};
8383

8484
function TEST(f) {

test/internet/test-dns-idna2008.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dns.lookup(
3434
}
3535
assert.ifError(err);
3636
assert.strictEqual(address, fixture.expectedAddress);
37-
})
37+
}),
3838
);
3939

4040
dns.promises.lookup(fixture.hostname, { family: fixture.family })

test/internet/test-dns-ipv4.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ TEST(async function test_lookup_ipv4_explicit_object(done) {
127127
validateResult(await dnsPromises.lookup(addresses.INET4_HOST, { family: 4 }));
128128

129129
const req = dns.lookup(addresses.INET4_HOST, {
130-
family: 4
130+
family: 4,
131131
}, common.mustSucceed((ip, family) => {
132132
validateResult({ address: ip, family });
133133
done();
@@ -143,11 +143,11 @@ TEST(async function test_lookup_ipv4_hint_addrconfig(done) {
143143
}
144144

145145
validateResult(await dnsPromises.lookup(addresses.INET4_HOST, {
146-
hints: dns.ADDRCONFIG
146+
hints: dns.ADDRCONFIG,
147147
}));
148148

149149
const req = dns.lookup(addresses.INET4_HOST, {
150-
hints: dns.ADDRCONFIG
150+
hints: dns.ADDRCONFIG,
151151
}, common.mustSucceed((ip, family) => {
152152
validateResult({ address: ip, family });
153153
done();
@@ -203,7 +203,7 @@ TEST(async function test_lookup_all_ipv4(done) {
203203

204204
validateResult(await dnsPromises.lookup(addresses.INET4_HOST, {
205205
all: true,
206-
family: 4
206+
family: 4,
207207
}));
208208

209209
const req = dns.lookup(
@@ -212,7 +212,7 @@ TEST(async function test_lookup_all_ipv4(done) {
212212
common.mustSucceed((ips) => {
213213
validateResult(ips);
214214
done();
215-
})
215+
}),
216216
);
217217

218218
checkWrap(req);
@@ -232,7 +232,7 @@ TEST(async function test_lookupservice_ip_ipv4(done) {
232232
common.mustSucceed((hostname, service) => {
233233
validateResult({ hostname, service });
234234
done();
235-
})
235+
}),
236236
);
237237

238238
checkWrap(req);

test/internet/test-dns-ipv6.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ TEST(async function test_lookup_ipv6_explicit_object(done) {
122122
validateResult(await dnsPromises.lookup(addresses.INET6_HOST, { family: 6 }));
123123

124124
const req = dns.lookup(addresses.INET6_HOST, {
125-
family: 6
125+
family: 6,
126126
}, common.mustSucceed((ip, family) => {
127127
validateResult({ address: ip, family });
128128
done();
@@ -134,7 +134,7 @@ TEST(async function test_lookup_ipv6_explicit_object(done) {
134134
TEST(function test_lookup_ipv6_hint(done) {
135135
const req = dns.lookup(addresses.INET6_HOST, {
136136
family: 6,
137-
hints: dns.V4MAPPED
137+
hints: dns.V4MAPPED,
138138
}, common.mustCall((err, ip, family) => {
139139
if (err) {
140140
// FreeBSD does not support V4MAPPED
@@ -191,7 +191,7 @@ TEST(async function test_lookup_all_ipv6(done) {
191191

192192
validateResult(await dnsPromises.lookup(addresses.INET6_HOST, {
193193
all: true,
194-
family: 6
194+
family: 6,
195195
}));
196196

197197
const req = dns.lookup(
@@ -200,7 +200,7 @@ TEST(async function test_lookup_all_ipv6(done) {
200200
common.mustSucceed((ips) => {
201201
validateResult(ips);
202202
done();
203-
})
203+
}),
204204
);
205205

206206
checkWrap(req);
@@ -220,7 +220,7 @@ TEST(function test_lookupservice_ip_ipv6(done) {
220220
assert(host);
221221
assert(['http', 'www', '80'].includes(service));
222222
done();
223-
})
223+
}),
224224
);
225225

226226
checkWrap(req);

test/internet/test-dns-lookup.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,35 @@ assert.rejects(
1111
dnsPromises.lookup(addresses.NOT_FOUND, {
1212
hints: 0,
1313
family: 0,
14-
all: false
14+
all: false,
1515
}),
1616
{
1717
code: 'ENOTFOUND',
18-
message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`
19-
}
18+
message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`,
19+
},
2020
);
2121

2222
assert.rejects(
2323
dnsPromises.lookup(addresses.NOT_FOUND, {
2424
hints: 0,
2525
family: 0,
26-
all: true
26+
all: true,
2727
}),
2828
{
2929
code: 'ENOTFOUND',
30-
message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`
31-
}
30+
message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`,
31+
},
3232
);
3333

3434
dns.lookup(addresses.NOT_FOUND, {
3535
hints: 0,
3636
family: 0,
37-
all: true
37+
all: true,
3838
}, common.mustCall((error) => {
3939
assert.strictEqual(error.code, 'ENOTFOUND');
4040
assert.strictEqual(
4141
error.message,
42-
`getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`
42+
`getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`,
4343
);
4444
assert.strictEqual(error.syscall, 'getaddrinfo');
4545
assert.strictEqual(error.hostname, addresses.NOT_FOUND);
@@ -48,7 +48,7 @@ dns.lookup(addresses.NOT_FOUND, {
4848
assert.throws(
4949
() => dnsPromises.lookup(addresses.NOT_FOUND, {
5050
family: 'ipv4',
51-
all: 'all'
51+
all: 'all',
5252
}),
53-
{ code: 'ERR_INVALID_ARG_VALUE' }
53+
{ code: 'ERR_INVALID_ARG_VALUE' },
5454
);

test/internet/test-dns-promises-resolve.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const dnsPromises = require('dns').promises;
1212
{
1313
code: 'ERR_INVALID_ARG_VALUE',
1414
name: 'TypeError',
15-
message: `The argument 'rrtype' is invalid. Received '${rrtype}'`
16-
}
15+
message: `The argument 'rrtype' is invalid. Received '${rrtype}'`,
16+
},
1717
);
1818
}
1919

@@ -26,8 +26,8 @@ const dnsPromises = require('dns').promises;
2626
code: 'ERR_INVALID_ARG_TYPE',
2727
name: 'TypeError',
2828
message: 'The "rrtype" argument must be of type string. ' +
29-
`Received type ${typeof rrtype} (${rrtype})`
30-
}
29+
`Received type ${typeof rrtype} (${rrtype})`,
30+
},
3131
);
3232
}
3333

0 commit comments

Comments
 (0)