Browse Source

test: improve test-assert.js

Verify error message thrown from assert.ifError

PR-URL: https://github.com/nodejs/node/pull/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>
v6.x
jobala 8 years ago
committed by Myles Borins
parent
commit
460a3e1f7a
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 3
      test/parallel/test-assert.js

3
test/parallel/test-assert.js

@ -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(); });

Loading…
Cancel
Save