Skip to content

Commit 7458293

Browse files
TrottMylesBorins
authored andcommitted
test: refactor test-fs-readfile-tostring-fail
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]>
1 parent 9c9263e commit 7458293

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/sequential/test-fs-readfile-tostring-fail.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ for (let i = 0; i < 201; i++) {
3030

3131
stream.end();
3232
stream.on('finish', common.mustCall(function() {
33-
// make sure that the toString does not throw an error
3433
fs.readFile(file, 'utf8', common.mustCall(function(err, buf) {
3534
assert.ok(err instanceof Error);
36-
assert(/^(Array buffer allocation failed|"toString\(\)" failed)$/
37-
.test(err.message));
35+
assert.ok(/^(Array buffer allocation failed|"toString\(\)" failed)$/
36+
.test(err.message));
3837
assert.strictEqual(buf, undefined);
3938
}));
4039
}));

0 commit comments

Comments
 (0)