Skip to content

Commit

Permalink
test: prepare tests for no-cond-assign ESLint rule
Browse files Browse the repository at this point in the history
PR-URL: #41614
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
Trott authored and danielleadams committed Mar 14, 2022
1 parent dacffd3 commit b06c33b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/parallel/test-child-process-flush-stdio.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const spawnWithReadable = () => {
}));
p.stdout.on('readable', () => {
let buf;
while (buf = p.stdout.read())
while ((buf = p.stdout.read()) !== null)
buffer.push(buf);
});
};
2 changes: 1 addition & 1 deletion test/parallel/test-net-server-max-connections.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function makeConnection(index) {
if (closes === N / 2) {
let cb;
console.error('calling wait callback.');
while (cb = waits.shift()) {
while ((cb = waits.shift()) !== undefined) {
cb();
}
server.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const BATCH = 10;
readable.on('readable', () => {
let data;
console.log('readable emitted');
while (data = readable.read()) {
while ((data = readable.read()) !== null) {
console.log(data);
}
});
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-stream-unshift-empty-chunk.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let readAll = false;
const seen = [];
r.on('readable', () => {
let chunk;
while (chunk = r.read()) {
while ((chunk = r.read()) !== null) {
seen.push(chunk.toString());
// Simulate only reading a certain amount of the data,
// and then putting the rest of the chunk back into the
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-zlib-brotli-flush.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ deflater.write(chunk, function() {
deflater.flush(function() {
const bufs = [];
let buf;
while (buf = deflater.read())
while ((buf = deflater.read()) !== null)
bufs.push(buf);
actualFull = Buffer.concat(bufs);
});
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-zlib-flush.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ deflater.write(chunk, function() {
deflater.flush(function() {
const bufs = [];
let buf;
while (buf = deflater.read())
while ((buf = deflater.read()) !== null)
bufs.push(buf);
actualFull = Buffer.concat(bufs);
});
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-zlib-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ deflater.write(chunk1, function() {
deflater.end(chunk2, function() {
const bufs = [];
let buf;
while (buf = deflater.read())
while ((buf = deflater.read()) !== null)
bufs.push(buf);
actual = Buffer.concat(bufs);
});
Expand Down

0 comments on commit b06c33b

Please sign in to comment.