Skip to content

Commit

Permalink
⛅ improve error check
Browse files Browse the repository at this point in the history
  • Loading branch information
Irvenae committed Apr 12, 2023
1 parent 78c62f9 commit 8a5b07c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import nowAndTimers from './now-and-timers.cjs';
import parseTestArgs from './parse-test-args.js';

function isExternalAssertError(error) {
if (typeof error !== 'object' || error === null) return false;
// Match errors thrown by <https://www.npmjs.com/package/expect>.
if (error.matcherResult) {
return true;
}
if (hasOwnProperty(error, 'matcherResult')) return true;

// Match errors thrown by <https://www.npmjs.com/package/chai> and <https://nodejs.org/api/assert.html>.
return hasOwnProperty(error, 'actual') && hasOwnProperty(error, 'expected');
Expand Down

0 comments on commit 8a5b07c

Please sign in to comment.