Permalink
Browse files

test: improve test-assert.js

Verify error message thrown from assert.ifError

PR-URL: #11193
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
  • Loading branch information...
jobala authored and jasnell committed Feb 1, 2017
1 parent 3d2bd7a commit 5f20d62c8fd89379b35bfa4610ff34551b4f1892
Showing with 2 additions and 1 deletion.
  1. +2 −1 test/parallel/test-assert.js
@@ -387,7 +387,8 @@ assert.throws(makeBlock(thrower, TypeError));
'a.doesNotThrow is not catching type matching errors');
}
assert.throws(function() { assert.ifError(new Error('test error')); });
assert.throws(function() { assert.ifError(new Error('test error')); },
/^Error: test error$/);
assert.doesNotThrow(function() { assert.ifError(null); });
assert.doesNotThrow(function() { assert.ifError(); });

0 comments on commit 5f20d62

Please sign in to comment.