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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
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

+2-1
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)