Skip to content

Commit

Permalink
test: improve test-assert.js
Browse files Browse the repository at this point in the history
Verify error message thrown from assert.ifError

PR-URL: #11193
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
  • Loading branch information
jobala authored and jasnell committed Mar 7, 2017
1 parent 49dfa89 commit d0036c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ try {
assert.equal(true, threw,
'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(); });

Expand Down

0 comments on commit d0036c7

Please sign in to comment.