summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-buffer.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2016-12-30 10:54:01 -0500
committercjihrig <cjihrig@gmail.com>2017-01-02 09:48:52 -0500
commit746a46ebddf594370137042b9b3a0af80daff903 (patch)
tree3defd7922c80a984bd0422cf6bdcf4ab3dd81aa1 /test/parallel/test-fs-buffer.js
parent152bd82de9b49e0497a2fe267c1d04207d837f40 (diff)
downloadandroid-node-v8-746a46ebddf594370137042b9b3a0af80daff903.tar.gz
android-node-v8-746a46ebddf594370137042b9b3a0af80daff903.tar.bz2
android-node-v8-746a46ebddf594370137042b9b3a0af80daff903.zip
test: increase usage of assert.ifError()
PR-URL: https://github.com/nodejs/node/pull/10543 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test/parallel/test-fs-buffer.js')
-rw-r--r--test/parallel/test-fs-buffer.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-fs-buffer.js b/test/parallel/test-fs-buffer.js
index 6f142310f5..1452143a91 100644
--- a/test/parallel/test-fs-buffer.js
+++ b/test/parallel/test-fs-buffer.js
@@ -9,14 +9,14 @@ common.refreshTmpDir();
assert.doesNotThrow(() => {
fs.access(Buffer.from(common.tmpDir), common.mustCall((err) => {
- if (err) throw err;
+ assert.ifError(err);
}));
});
assert.doesNotThrow(() => {
const buf = Buffer.from(path.join(common.tmpDir, 'a.txt'));
fs.open(buf, 'w+', common.mustCall((err, fd) => {
- if (err) throw err;
+ assert.ifError(err);
assert(fd);
fs.close(fd, common.mustCall(() => {
fs.unlinkSync(buf);
@@ -30,12 +30,12 @@ assert.throws(() => {
const dir = Buffer.from(common.fixturesDir);
fs.readdir(dir, 'hex', common.mustCall((err, list) => {
- if (err) throw err;
+ assert.ifError(err);
list = list.map((i) => {
return Buffer.from(i, 'hex').toString();
});
fs.readdir(dir, common.mustCall((err, list2) => {
- if (err) throw err;
+ assert.ifError(err);
assert.deepStrictEqual(list, list2);
}));
}));