Skip to content

Commit f096235

Browse files
jobalaitaloacasas
jobala
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 b405699 commit f096235

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
@@ -387,7 +387,8 @@ assert.throws(makeBlock(thrower, TypeError));
387387
'a.doesNotThrow is not catching type matching errors');
388388
}
389389

390-
assert.throws(function() { assert.ifError(new Error('test error')); });
390+
assert.throws(function() { assert.ifError(new Error('test error')); },
391+
/^Error: test error$/);
391392
assert.doesNotThrow(function() { assert.ifError(null); });
392393
assert.doesNotThrow(function() { assert.ifError(); });
393394

0 commit comments

Comments
 (0)