Skip to content

Commit

Permalink
test: fix arguments order
Browse files Browse the repository at this point in the history
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: nodejs#24151
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
simonaco authored and Trott committed Nov 9, 2018
1 parent 16a199a commit e1c4e91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/parallel/test-fs-readfile-empty.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'), '');

0 comments on commit e1c4e91

Please sign in to comment.