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

‎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
constchild=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
constproc=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'
@@ -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

‎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
letoffset=12;
@@ -185,7 +185,7 @@ function writeDomainName(domain){
185185
assert(label.length<64);
186186
returnBuffer.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(newUint16Array([
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(newUint16Array([
223223
types[rr.type],
224-
rr.cls===undefined ? classes.IN : rr.cls
224+
rr.cls===undefined ? classes.IN : rr.cls,
225225
]));
226226
buffers.push(newInt32Array([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(newUint32Array([
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
@@ -612,7 +612,7 @@ function getArrayBufferViews(buf){
612612
Uint32Array,
613613
Float32Array,
614614
Float64Array,
615-
DataView
615+
DataView,
616616
];
617617

618618
for(consttypeofarrayBufferViews){

‎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
consttimeout=timeoutPromise(error,timeoutMs);
516516
returnPromise.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
constcompressions=Buffer.from('0100','hex');// null
4646
constmsg=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
returnaddRecordHeader(0x16,msg);

‎test/doctool/test-doctool-json.js‎

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

0 commit comments

Comments
(0)