Skip to content

Commit

Permalink
test: fix assert.strictEqual argument order
Browse files Browse the repository at this point in the history
The arguments to assert.strictEqual in a number of calls were in the
wrong order. It is preferred that literal values are in the second
argument.

Updates test/parallel/test-fs-readStream.js

PR-URL: #24172
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
mcqj authored and BridgeAR committed Nov 13, 2018
1 parent 2593b40 commit 768425f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-fs-read-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const rangeFile = fixtures.path('x.txt');

file.on('open', common.mustCall(function(fd) {
file.length = 0;
assert.strictEqual('number', typeof fd);
assert.strictEqual(typeof fd, 'number');
assert.strictEqual(file.bytesRead, 0);
assert.ok(file.readable);

Expand Down Expand Up @@ -91,12 +91,12 @@ const rangeFile = fixtures.path('x.txt');
const file = fs.createReadStream(fn, { encoding: 'utf8' });
file.length = 0;
file.on('data', function(data) {
assert.strictEqual('string', typeof data);
assert.strictEqual(typeof data, 'string');
file.length += data.length;

for (let i = 0; i < data.length; i++) {
// http://www.fileformat.info/info/unicode/char/2026/index.htm
assert.strictEqual('\u2026', data[i]);
assert.strictEqual(data[i], '\u2026');
}
});

Expand Down Expand Up @@ -162,7 +162,7 @@ common.expectsError(
});

stream.on('end', common.mustCall(function() {
assert.strictEqual('x', stream.data);
assert.strictEqual(stream.data, 'x');
}));
}

Expand All @@ -176,7 +176,7 @@ common.expectsError(
});

stream.on('end', common.mustCall(function() {
assert.strictEqual('xy', stream.data);
assert.strictEqual(stream.data, 'xy');
}));
}

Expand All @@ -197,7 +197,7 @@ if (!common.isWindows) {
});

stream.on('end', common.mustCall(function() {
assert.strictEqual('xy', stream.data);
assert.strictEqual(stream.data, 'xy');
fs.unlinkSync(filename);
}));
} else {
Expand Down

0 comments on commit 768425f

Please sign in to comment.