Skip to content

Commit a2e4020

Browse files
Trotttargos
authored andcommitted
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 <jasnell@gmail.com> Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
1 parent 315eba7 commit a2e4020

File tree

385 files changed

+879
-864
lines changed

Some content is hidden

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

385 files changed

+879
-864
lines changed

test/abort/test-worker-abort-uncaught-exception.js

Lines changed: 1 addition & 1 deletion
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) {

test/addons/register-signal-handler/test.js

Lines changed: 1 addition & 1 deletion
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,

test/addons/worker-addon/test.js

Lines changed: 2 additions & 2 deletions
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(), '');

test/async-hooks/test-graph.tls-write.js

Lines changed: 1 addition & 1 deletion
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
}

test/common/README.md

Lines changed: 5 additions & 5 deletions
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'
@@ -667,9 +667,9 @@ validateSnapshotNodes('TLSWRAP', [
667667
children: [
668668
{ name: 'enc_out' },
669669
{ name: 'enc_in' },
670-
{ name: 'TLSWrap' }
670+
{ name: 'TLSWrap' },
671671
]
672-
}
672+
},
673673
]);
674674
```
675675

test/common/dns.js

Lines changed: 5 additions & 5 deletions
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
}

test/common/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ function getArrayBufferViews(buf) {
614614
Uint32Array,
615615
Float32Array,
616616
Float64Array,
617-
DataView
617+
DataView,
618618
];
619619

620620
for (const type of arrayBufferViews) {

test/common/inspector-helper.js

Lines changed: 1 addition & 1 deletion
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

test/common/tls.js

Lines changed: 1 addition & 1 deletion
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);

test/doctool/test-doctool-json.mjs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const testData = [
7171
name: 'array',
7272
type: 'Array'
7373
}]
74-
}
74+
},
7575
]
7676
}],
7777
type: 'module',
@@ -113,7 +113,7 @@ const testData = [
113113
{ 'version': 'v4.2.0',
114114
'pr-url': 'https://github.com/nodejs/node/pull/3276',
115115
'description': 'The `error` parameter can now be ' +
116-
'an arrow function.' }
116+
'an arrow function.' },
117117
]
118118
},
119119
desc: '<p>Describe <code>Foobar II</code> in more detail ' +
@@ -141,11 +141,11 @@ const testData = [
141141
'Describe <code>Something</code> in more detail here.</p>',
142142
type: 'module',
143143
displayName: 'Something'
144-
}
144+
},
145145
],
146146
type: 'module',
147147
displayName: 'Sample Markdown with YAML info'
148-
}
148+
},
149149
]
150150
}
151151
},
@@ -162,61 +162,61 @@ const testData = [
162162
{
163163
name: 'fullName',
164164
textRaw: '`Fqhqwhgads.fullName`'
165-
}
165+
},
166166
],
167167
classMethods: [
168168
{
169169
name: 'again',
170170
signatures: [
171171
{
172172
params: []
173-
}
173+
},
174174
],
175175
textRaw: 'Static method: `Fhqwhgads.again()`',
176176
type: 'classMethod'
177-
}
177+
},
178178
],
179179
classes: [
180180
{
181181
textRaw: 'Class: `ComeOn`',
182182
type: 'class',
183183
name: 'ComeOn'
184-
}
184+
},
185185
],
186186
ctors: [
187187
{
188188
name: 'Fhqwhgads',
189189
signatures: [
190190
{
191191
params: []
192-
}
192+
},
193193
],
194194
textRaw: 'Constructor: `new Fhqwhgads()`',
195195
type: 'ctor'
196-
}
196+
},
197197
],
198198
methods: [
199199
{
200200
textRaw: '`everybody.to(limit)`',
201201
type: 'method',
202202
name: 'to',
203203
signatures: [{ params: [] }]
204-
}
204+
},
205205
],
206206
events: [
207207
{
208208
textRaw: "Event: `'FHQWHfest'`",
209209
type: 'event',
210210
name: 'FHQWHfest',
211211
params: []
212-
}
212+
},
213213
],
214214
type: 'module',
215215
displayName: 'Fhqwhgads'
216-
}
216+
},
217217
]
218218
}
219-
}
219+
},
220220
];
221221

222222
testData.forEach((item) => {

test/es-module/test-esm-json.mjs

Lines changed: 1 addition & 1 deletion
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 = '';

test/es-module/test-esm-nowarn-exports.mjs

Lines changed: 1 addition & 1 deletion
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 = '';

test/es-module/test-esm-preserve-symlinks-main.js

Lines changed: 1 addition & 1 deletion
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);

test/es-module/test-esm-repl.js

Lines changed: 1 addition & 1 deletion
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(

test/es-module/test-esm-specifiers.mjs

Lines changed: 1 addition & 1 deletion
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],

test/es-module/test-esm-symlink-type.js

Lines changed: 2 additions & 2 deletions
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 = {

test/es-module/test-esm-wasm.mjs

Lines changed: 1 addition & 1 deletion
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 = '';

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

Lines changed: 1 addition & 1 deletion
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;

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

Lines changed: 1 addition & 1 deletion
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

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

Lines changed: 1 addition & 1 deletion
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;

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

Lines changed: 1 addition & 1 deletion
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;

test/internet/test-dns-cares-domains.js

Lines changed: 1 addition & 1 deletion
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) {

test/internet/test-trace-events-dns.js

Lines changed: 1 addition & 1 deletion
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

test/js-native-api/test_array/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const array = [
1515
[
1616
'world',
1717
'node',
18-
'abi'
19-
]
18+
'abi',
19+
],
2020
];
2121

2222
assert.throws(

0 commit comments

Comments
 (0)