Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: fix assert.strictEqual argument order
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
  • Loading branch information
mcqj committed Nov 6, 2018
commit a0e8faad5535b2e171940453e5ea800b6f646156
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