Skip to content

Commit

Permalink
lib/test: IMprove isError checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raynos committed Jan 2, 2021
1 parent 533b6a9 commit d816458
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ Test.prototype.run = function () {
self.end();
}
})['catch'](function onError(err) {
if (objectToString(err) === '[object Error]') {
var isErr = err instanceof Error ||
objectToString(err) === '[object Error]';
if (isErr) {
self.ifError(err);
} else {
self.fail(err);
Expand Down

0 comments on commit d816458

Please sign in to comment.