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>
This commit is contained in:
jobala authored and Myles Borins committed 2017-03-08 17:10:41 -08:00
1 parent b90a141cc7
commit 460a3e1f7a
1 file changed
+2 -1
+2 -1
View File
@@ -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(); });