Skip to content

Commit 431c803

Browse files
jobalakrydos
authored andcommitted
test: improve test-assert.js
Verify error message thrown from assert.ifError PR-URL: nodejs#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 39c457b commit 431c803

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)