Skip to content

Commit 460a3e1

Browse files
jobalaMylesBorins
authored andcommitted
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>
1 parent b90a141 commit 460a3e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/parallel/test-assert.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ try {
358358
assert.equal(true, threw,
359359
'a.doesNotThrow is not catching type matching errors');
360360

361-
assert.throws(function() { assert.ifError(new Error('test error')); });
361+
assert.throws(function() { assert.ifError(new Error('test error')); },
362+
/^Error: test error$/);
362363
assert.doesNotThrow(function() { assert.ifError(null); });
363364
assert.doesNotThrow(function() { assert.ifError(); });
364365

0 commit comments

Comments
 (0)