From 3a67c0d7c30afd478e6543bb93f3b4313a795827 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 16 Mar 2018 22:12:37 -0700 Subject: [PATCH] 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. --- test/sequential/test-fs-readfile-tostring-fail.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/sequential/test-fs-readfile-tostring-fail.js b/test/sequential/test-fs-readfile-tostring-fail.js index 88cf7347efbfdf..81c7a941eb9476 100644 --- a/test/sequential/test-fs-readfile-tostring-fail.js +++ b/test/sequential/test-fs-readfile-tostring-fail.js @@ -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); })); }));