mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
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:
1 parent
b90a141cc7
commit
460a3e1f7a
1 file changed
+2
-1
@@ -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(); });
|
||||
|
||||
|
||||
Reference in new issue
Block a user