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: nodejs#19404
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
Trott committed Mar 20, 2018
1 parent 6a958d2 commit 1203b13
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 1203b13

Please sign in to comment.