Skip to content

Commit b06c33b

Browse files
Trottdanielleadams
authored andcommitted
test: prepare tests for no-cond-assign ESLint rule
PR-URL: #41614 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent dacffd3 commit b06c33b

7 files changed

Lines changed: 7 additions & 7 deletions

‎test/parallel/test-child-process-flush-stdio.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const spawnWithReadable = () => {
2727
}));
2828
p.stdout.on('readable',()=>{
2929
letbuf;
30-
while(buf=p.stdout.read())
30+
while((buf=p.stdout.read())!==null)
3131
buffer.push(buf);
3232
});
3333
};

‎test/parallel/test-net-server-max-connections.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function makeConnection(index) {
6868
if(closes===N/2){
6969
letcb;
7070
console.error('calling wait callback.');
71-
while(cb=waits.shift()){
71+
while((cb=waits.shift())!==undefined){
7272
cb();
7373
}
7474
server.close();

‎test/parallel/test-stream-readable-object-multi-push-async.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const BATCH = 10;
4747
readable.on('readable',()=>{
4848
letdata;
4949
console.log('readable emitted');
50-
while(data=readable.read()){
50+
while((data=readable.read())!==null){
5151
console.log(data);
5252
}
5353
});

‎test/parallel/test-stream-unshift-empty-chunk.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ let readAll = false;
4141
constseen=[];
4242
r.on('readable',()=>{
4343
letchunk;
44-
while(chunk=r.read()){
44+
while((chunk=r.read())!==null){
4545
seen.push(chunk.toString());
4646
// Simulate only reading a certain amount of the data,
4747
// and then putting the rest of the chunk back into the

‎test/parallel/test-zlib-brotli-flush.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ deflater.write(chunk, function() {
1616
deflater.flush(function(){
1717
constbufs=[];
1818
letbuf;
19-
while(buf=deflater.read())
19+
while((buf=deflater.read())!==null)
2020
bufs.push(buf);
2121
actualFull=Buffer.concat(bufs);
2222
});

‎test/parallel/test-zlib-flush.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ deflater.write(chunk, function() {
2323
deflater.flush(function(){
2424
constbufs=[];
2525
letbuf;
26-
while(buf=deflater.read())
26+
while((buf=deflater.read())!==null)
2727
bufs.push(buf);
2828
actualFull=Buffer.concat(bufs);
2929
});

‎test/parallel/test-zlib-params.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ deflater.write(chunk1, function() {
2121
deflater.end(chunk2,function(){
2222
constbufs=[];
2323
letbuf;
24-
while(buf=deflater.read())
24+
while((buf=deflater.read())!==null)
2525
bufs.push(buf);
2626
actual=Buffer.concat(bufs);
2727
});

0 commit comments

Comments
 (0)