Skip to content

Commit

Permalink
[Robustness] use cached .test
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 15, 2022
1 parent dfc5f39 commit 096a9e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/test.js
Expand Up @@ -654,7 +654,7 @@ Test.prototype['throws'] = function (fn, expected, msg, extra) {
passed = expected.call({}, caught.error) === true;
}
} else if (isRegExp(expected)) {
passed = expected.test(caught.error);
passed = $test(expected, caught.error);
expected = inspect(expected);
} else if (expected && typeof expected === 'object') { // Handle validation objects.
var keys = objectKeys(expected);
Expand Down

0 comments on commit 096a9e0

Please sign in to comment.