Skip to content

Commit

Permalink
Merge pull request #446 from danielbprice/master
Browse files Browse the repository at this point in the history
Issue #442 chai can't cope with AssertionErrors raised from node's assert
  • Loading branch information
keithamus committed Oct 2, 2015
2 parents 22fbd65 + ab02c6f commit 7f5a108
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/chai/core/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1247,9 +1247,9 @@ module.exports = function (chai, _) {
constructor = null;
errMsg = null;
} else if (typeof constructor === 'function') {
name = constructor.prototype.name || constructor.name;
if (name === 'Error' && constructor !== Error) {
name = (new constructor()).name;
name = constructor.prototype.name;
if (!name || (name === 'Error' && constructor !== Error)) {
name = constructor.name || (new constructor()).name;
}
} else {
constructor = null;
Expand Down

0 comments on commit 7f5a108

Please sign in to comment.