Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3bb6372

Browse filesBrowse files
mcqjMylesBorins
authored andcommitted
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 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>
1 parent 1ec6923 commit 3bb6372
Copy full SHA for 3bb6372

File tree

Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-fs-read-stream.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-read-stream.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const rangeFile = fixtures.path('x.txt');
4242

4343
file.on('open', common.mustCall(function(fd) {
4444
file.length = 0;
45-
assert.strictEqual('number', typeof fd);
45+
assert.strictEqual(typeof fd, 'number');
4646
assert.strictEqual(file.bytesRead, 0);
4747
assert.ok(file.readable);
4848

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

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

@@ -162,7 +162,7 @@ common.expectsError(
162162
});
163163

164164
stream.on('end', common.mustCall(function() {
165-
assert.strictEqual('x', stream.data);
165+
assert.strictEqual(stream.data, 'x');
166166
}));
167167
}
168168

@@ -176,7 +176,7 @@ common.expectsError(
176176
});
177177

178178
stream.on('end', common.mustCall(function() {
179-
assert.strictEqual('xy', stream.data);
179+
assert.strictEqual(stream.data, 'xy');
180180
}));
181181
}
182182

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

199199
stream.on('end', common.mustCall(function() {
200-
assert.strictEqual('xy', stream.data);
200+
assert.strictEqual(stream.data, 'xy');
201201
fs.unlinkSync(filename);
202202
}));
203203
} else {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.