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: nodejs#24172
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
mcqj authored and kiyomizumia committed Nov 15, 2018
1 parent babc54c commit fac182f
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 fac182f

Please sign in to comment.