Skip to content

Commit

Permalink
test: refactor test-fs-readfile-tostring-fail
Browse files Browse the repository at this point in the history
The test uses both `assert()` and `assert.ok()`. Use just `assert.ok()`.

Remove a comment that does not appear to match the code and does not
seem to explain much beyond the bare code itself.

PR-URL: #19404
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Shingo Inoue <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
Trott authored and MylesBorins committed Mar 22, 2018
1 parent 9c9263e commit 7458293
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/sequential/test-fs-readfile-tostring-fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ for (let i = 0; i < 201; i++) {

stream.end();
stream.on('finish', common.mustCall(function() {
// make sure that the toString does not throw an error
fs.readFile(file, 'utf8', common.mustCall(function(err, buf) {
assert.ok(err instanceof Error);
assert(/^(Array buffer allocation failed|"toString\(\)" failed)$/
.test(err.message));
assert.ok(/^(Array buffer allocation failed|"toString\(\)" failed)$/
.test(err.message));
assert.strictEqual(buf, undefined);
}));
}));
Expand Down

0 comments on commit 7458293

Please sign in to comment.