Skip to content

Commit 330f25e

Browse files
committed
test: prepare for consistent comma-dangle lint rule
Make changes so that tests will pass when the comma-dangle settings applied to the rest of the code base are also applied to tests. PR-URL: #37930 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Derek Lewis <[email protected]>
1 parent f0bf373 commit 330f25e

File tree

407 files changed

+962
-962
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

407 files changed

+962
-962
lines changed

Diff for: test/abort/test-worker-abort-uncaught-exception.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if (process.argv[2] === 'child') {
1212
}
1313

1414
const child = spawn(process.execPath, [
15-
'--abort-on-uncaught-exception', __filename, 'child'
15+
'--abort-on-uncaught-exception', __filename, 'child',
1616
]);
1717
child.on('exit', common.mustCall((code, sig) => {
1818
if (common.isWindows) {

Diff for: test/addons/register-signal-handler/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ for (const raiseSignal of [ 'SIGABRT', 'SIGSEGV' ]) {
3434
{ reset: true, count: 1, stderr: [signo], code: 0, signal: null },
3535
{ reset: true, count: 2, stderr: [signo], code: null, signal: raiseSignal },
3636
{ reset: false, count: 1, stderr: [signo], code: 0, signal: null },
37-
{ reset: false, count: 2, stderr: [signo, signo], code: 0, signal: null }
37+
{ reset: false, count: 2, stderr: [signo, signo], code: 0, signal: null },
3838
]) {
3939
// We do not want to generate core files when running this test as an
4040
// addon test. We require this file as an abort test as well, though,

Diff for: test/addons/worker-addon/test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ for (const { test, expected } of [
4848
// musl doesn't support unloading, so the output may be missing
4949
// a dtor + ctor pair.
5050
expected: [
51-
'ctor cleanup dtor ctor cleanup dtor '
51+
'ctor cleanup dtor ctor cleanup dtor ',
5252
].concat(libcMayBeMusl ? [
5353
'ctor cleanup cleanup dtor ',
5454
] : [])
@@ -57,7 +57,7 @@ for (const { test, expected } of [
5757
console.log('spawning test', test);
5858
const proc = child_process.spawnSync(process.execPath, [
5959
__filename,
60-
test
60+
test,
6161
]);
6262
process.stderr.write(proc.stderr.toString());
6363
assert.strictEqual(proc.stderr.toString(), '');

Diff for: test/async-hooks/test-graph.tls-write.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function onexit() {
6565
{ type: 'TCPCONNECTWRAP',
6666
id: 'tcpconnect:1', triggerAsyncId: 'tcp:1' },
6767
{ type: 'TCPWRAP', id: 'tcp:2', triggerAsyncId: 'tcpserver:1' },
68-
{ type: 'TLSWRAP', id: 'tls:2', triggerAsyncId: 'tcpserver:1' }
68+
{ type: 'TLSWRAP', id: 'tls:2', triggerAsyncId: 'tcpserver:1' },
6969
]
7070
);
7171
}

Diff for: test/common/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ expectWarning('Warning', 'Foobar is really bad');
115115
expectWarning('DeprecationWarning', 'Foobar is deprecated', 'DEP0XXX');
116116

117117
expectWarning('DeprecationWarning', [
118-
'Foobar is deprecated', 'DEP0XXX'
118+
'Foobar is deprecated', 'DEP0XXX',
119119
]);
120120

121121
expectWarning('DeprecationWarning', [
122122
['Foobar is deprecated', 'DEP0XXX'],
123-
['Baz is also deprecated', 'DEP0XX2']
123+
['Baz is also deprecated', 'DEP0XX2'],
124124
]);
125125

126126
expectWarning('DeprecationWarning', {
@@ -135,7 +135,7 @@ expectWarning({
135135
},
136136
Warning: [
137137
['Multiple array entries are fine', 'SpecialWarningCode'],
138-
['No code is also fine']
138+
['No code is also fine'],
139139
],
140140
SingleEntry: ['This will also work', 'WarningCode'],
141141
SingleString: 'Single string entries without code will also work'
@@ -665,9 +665,9 @@ validateSnapshotNodes('TLSWRAP', [
665665
children: [
666666
{ name: 'enc_out' },
667667
{ name: 'enc_in' },
668-
{ name: 'TLSWrap' }
668+
{ name: 'TLSWrap' },
669669
]
670-
}
670+
},
671671
]);
672672
```
673673

Diff for: test/common/dns.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function parseDNSPacket(buffer) {
6060
['questions', buffer.readUInt16BE(4)],
6161
['answers', buffer.readUInt16BE(6)],
6262
['authorityAnswers', buffer.readUInt16BE(8)],
63-
['additionalRecords', buffer.readUInt16BE(10)]
63+
['additionalRecords', buffer.readUInt16BE(10)],
6464
];
6565

6666
let offset = 12;
@@ -185,7 +185,7 @@ function writeDomainName(domain) {
185185
assert(label.length < 64);
186186
return Buffer.concat([
187187
Buffer.from([label.length]),
188-
Buffer.from(label, 'ascii')
188+
Buffer.from(label, 'ascii'),
189189
]);
190190
}).concat([Buffer.alloc(1)]));
191191
}
@@ -208,7 +208,7 @@ function writeDNSPacket(parsed) {
208208
buffers.push(writeDomainName(q.domain));
209209
buffers.push(new Uint16Array([
210210
types[q.type],
211-
q.cls === undefined ? classes.IN : q.cls
211+
q.cls === undefined ? classes.IN : q.cls,
212212
]));
213213
}
214214

@@ -221,7 +221,7 @@ function writeDNSPacket(parsed) {
221221
buffers.push(writeDomainName(rr.domain));
222222
buffers.push(new Uint16Array([
223223
types[rr.type],
224-
rr.cls === undefined ? classes.IN : rr.cls
224+
rr.cls === undefined ? classes.IN : rr.cls,
225225
]));
226226
buffers.push(new Int32Array([rr.ttl]));
227227

@@ -266,7 +266,7 @@ function writeDNSPacket(parsed) {
266266
rdLengthBuf[0] = mname.length + rname.length + 20;
267267
buffers.push(mname, rname);
268268
buffers.push(new Uint32Array([
269-
rr.serial, rr.refresh, rr.retry, rr.expire, rr.minttl
269+
rr.serial, rr.refresh, rr.retry, rr.expire, rr.minttl,
270270
]));
271271
break;
272272
}

Diff for: test/common/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ function getArrayBufferViews(buf) {
612612
Uint32Array,
613613
Float32Array,
614614
Float64Array,
615-
DataView
615+
DataView,
616616
];
617617

618618
for (const type of arrayBufferViews) {

Diff for: test/common/inspector-helper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ function fires(promise, error, timeoutMs) {
515515
const timeout = timeoutPromise(error, timeoutMs);
516516
return Promise.race([
517517
onResolvedOrRejected(promise, () => timeout.clear()),
518-
timeout
518+
timeout,
519519
]);
520520
}
521521

Diff for: test/common/tls.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class TestTLSSocket extends net.Socket {
4444
createClientHello() {
4545
const compressions = Buffer.from('0100', 'hex'); // null
4646
const msg = addHandshakeHeader(0x01, Buffer.concat([
47-
this.version, this.client_random, this.ciphers, compressions
47+
this.version, this.client_random, this.ciphers, compressions,
4848
]));
4949
this.emit('handshake', msg);
5050
return addRecordHeader(0x16, msg);

Diff for: test/doctool/test-doctool-json.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const testData = [
7979
name: 'array',
8080
type: 'Array'
8181
}]
82-
}
82+
},
8383
]
8484
}],
8585
type: 'module',
@@ -121,7 +121,7 @@ const testData = [
121121
{ 'version': 'v4.2.0',
122122
'pr-url': 'https://github.com/nodejs/node/pull/3276',
123123
'description': 'The `error` parameter can now be ' +
124-
'an arrow function.' }
124+
'an arrow function.' },
125125
]
126126
},
127127
desc: '<p>Describe <code>Foobar II</code> in more detail ' +
@@ -149,11 +149,11 @@ const testData = [
149149
'Describe <code>Something</code> in more detail here.</p>',
150150
type: 'module',
151151
displayName: 'Something'
152-
}
152+
},
153153
],
154154
type: 'module',
155155
displayName: 'Sample Markdown with YAML info'
156-
}
156+
},
157157
]
158158
}
159159
},
@@ -170,61 +170,61 @@ const testData = [
170170
{
171171
name: 'fullName',
172172
textRaw: '`Fqhqwhgads.fullName`'
173-
}
173+
},
174174
],
175175
classMethods: [
176176
{
177177
name: 'again',
178178
signatures: [
179179
{
180180
params: []
181-
}
181+
},
182182
],
183183
textRaw: 'Static method: `Fhqwhgads.again()`',
184184
type: 'classMethod'
185-
}
185+
},
186186
],
187187
classes: [
188188
{
189189
textRaw: 'Class: `ComeOn`',
190190
type: 'class',
191191
name: 'ComeOn'
192-
}
192+
},
193193
],
194194
ctors: [
195195
{
196196
name: 'Fhqwhgads',
197197
signatures: [
198198
{
199199
params: []
200-
}
200+
},
201201
],
202202
textRaw: 'Constructor: `new Fhqwhgads()`',
203203
type: 'ctor'
204-
}
204+
},
205205
],
206206
methods: [
207207
{
208208
textRaw: '`everybody.to(limit)`',
209209
type: 'method',
210210
name: 'to',
211211
signatures: [{ params: [] }]
212-
}
212+
},
213213
],
214214
events: [
215215
{
216216
textRaw: "Event: `'FHQWHfest'`",
217217
type: 'event',
218218
name: 'FHQWHfest',
219219
params: []
220-
}
220+
},
221221
],
222222
type: 'module',
223223
displayName: 'Fhqwhgads'
224-
}
224+
},
225225
]
226226
}
227-
}
227+
},
228228
];
229229

230230
testData.forEach((item) => {

Diff for: test/es-module/test-esm-exports-pending-deprecations.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const expectedWarnings = [
88
'"./fallbackdir/"',
99
'"./subpath/"',
1010
'no_exports',
11-
'default_index'
11+
'default_index',
1212
];
1313

1414
process.addListener('warning', mustCall((warning) => {

Diff for: test/es-module/test-esm-json.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ strictEqual(secret.ofLife, 42);
1111
// Test warning message
1212
const child = spawn(process.execPath, [
1313
'--experimental-json-modules',
14-
path('/es-modules/json-modules.mjs')
14+
path('/es-modules/json-modules.mjs'),
1515
]);
1616

1717
let stderr = '';

Diff for: test/es-module/test-esm-nowarn-exports.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { spawn } from 'child_process';
55

66
const child = spawn(process.execPath, [
77
'--experimental-import-meta-resolve',
8-
path('/es-modules/import-resolve-exports.mjs')
8+
path('/es-modules/import-resolve-exports.mjs'),
99
]);
1010

1111
let stderr = '';

Diff for: test/es-module/test-esm-preserve-symlinks-main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function doTest(flags, done) {
4242
spawn(process.execPath,
4343
flags.concat([
4444
'--preserve-symlinks',
45-
'--preserve-symlinks-main', entry_link_absolute_path
45+
'--preserve-symlinks-main', entry_link_absolute_path,
4646
]),
4747
{ stdio: 'inherit' }).on('exit', (code) => {
4848
assert.strictEqual(code, 0);

Diff for: test/es-module/test-esm-repl.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const assert = require('assert');
44
const { spawn } = require('child_process');
55

66
const child = spawn(process.execPath, [
7-
'--interactive'
7+
'--interactive',
88
]);
99
child.stdin.end(`
1010
import('fs').then(

Diff for: test/es-module/test-esm-specifiers.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ main().catch(mustNotCall);
5151
);
5252
[
5353
'--experimental-specifier-resolution',
54-
'--es-module-specifier-resolution'
54+
'--es-module-specifier-resolution',
5555
].forEach((option) => {
5656
spawn(process.execPath,
5757
[`${option}=node`, modulePath],

Diff for: test/es-module/test-esm-symlink-type.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const symlinks = [
4040
target: fixtures.path('es-modules/package-without-type/index.js'),
4141
prints: 'package-without-type',
4242
errorsWithPreserveSymlinksMain: false
43-
}
43+
},
4444
];
4545

4646
symlinks.forEach((symlink) => {
@@ -49,7 +49,7 @@ symlinks.forEach((symlink) => {
4949

5050
const flags = [
5151
'',
52-
'--preserve-symlinks-main'
52+
'--preserve-symlinks-main',
5353
];
5454
flags.forEach((nodeOptions) => {
5555
const opts = {

Diff for: test/es-module/test-esm-wasm.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ strictEqual(addImported(1), 43);
1919
// Test warning message
2020
const child = spawn(process.execPath, [
2121
'--experimental-wasm-modules',
22-
path('/es-modules/wasm-modules.mjs')
22+
path('/es-modules/wasm-modules.mjs'),
2323
]);
2424

2525
let stderr = '';

Diff for: test/internet/test-dgram-multicast-multi-process.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const messages = [
3535
Buffer.from('First message to send'),
3636
Buffer.from('Second message to send'),
3737
Buffer.from('Third message to send'),
38-
Buffer.from('Fourth message to send')
38+
Buffer.from('Fourth message to send'),
3939
];
4040
const workers = {};
4141
const listeners = 3;

Diff for: test/internet/test-dgram-multicast-set-interface-lo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const messages = [
7070
{ tail: 'Fourth message to send', mcast: MULTICASTS[FAM][2] },
7171
{ tail: 'Fifth message to send', mcast: MULTICASTS[FAM][1], rcv: true },
7272
{ tail: 'Sixth message to send', mcast: MULTICASTS[FAM][2], rcv: true,
73-
newAddr: LOOPBACK[FAM] }
73+
newAddr: LOOPBACK[FAM] },
7474
];
7575

7676

Diff for: test/internet/test-dgram-multicast-ssm-multi-process.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const messages = [
1414
Buffer.from('First message to send'),
1515
Buffer.from('Second message to send'),
1616
Buffer.from('Third message to send'),
17-
Buffer.from('Fourth message to send')
17+
Buffer.from('Fourth message to send'),
1818
];
1919
const workers = {};
2020
const listeners = 3;

Diff for: test/internet/test-dgram-multicast-ssmv6-multi-process.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const messages = [
1414
Buffer.from('First message to send'),
1515
Buffer.from('Second message to send'),
1616
Buffer.from('Third message to send'),
17-
Buffer.from('Fourth message to send')
17+
Buffer.from('Fourth message to send'),
1818
];
1919
const workers = {};
2020
const listeners = 3;

Diff for: test/internet/test-dns-cares-domains.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const methods = [
1515
'resolveSrv',
1616
'resolvePtr',
1717
'resolveNaptr',
18-
'resolveSoa'
18+
'resolveSoa',
1919
];
2020

2121
methods.forEach(function(method) {

Diff for: test/internet/test-trace-events-dns.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ for (const tr in tests) {
4545
[ '--trace-event-categories',
4646
'node.dns.native',
4747
'-e',
48-
test_str + tests[tr]
48+
test_str + tests[tr],
4949
],
5050
{ encoding: 'utf8' });
5151

0 commit comments

Comments
 (0)