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:
Simona Cotin 2018-11-06 15:11:41 +00:00 committed by Rich Trott
parent 16a199ad05
commit e1c4e918c3

View File

@ -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'), '');