test: fix arguments order
the actual and expected arguments in assert.strictEqual() calls are in the wrong order. Any literal value should be the second argument while the first argument should be the value returned by a function/be the calculated value. PR-URL: https://github.com/nodejs/node/pull/24151 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>
This commit is contained in:
parent
16a199ad05
commit
e1c4e918c3
@ -35,12 +35,12 @@ fs.readFile(fn, function(err, data) {
|
||||
});
|
||||
|
||||
fs.readFile(fn, 'utf8', function(err, data) {
|
||||
assert.strictEqual('', data);
|
||||
assert.strictEqual(data, '');
|
||||
});
|
||||
|
||||
fs.readFile(fn, { encoding: 'utf8' }, function(err, data) {
|
||||
assert.strictEqual('', data);
|
||||
assert.strictEqual(data, '');
|
||||
});
|
||||
|
||||
assert.ok(fs.readFileSync(fn));
|
||||
assert.strictEqual('', fs.readFileSync(fn, 'utf8'));
|
||||
assert.strictEqual(fs.readFileSync(fn, 'utf8'), '');
|
||||
|
Loading…
x
Reference in New Issue
Block a user