Skip to content

Commit

Permalink
Adding a compare function to be used in expected object template (cha…
Browse files Browse the repository at this point in the history
…ijs#66)

* Adding compare function to be used in expected object template

* Adding compare function example to README.md
  • Loading branch information
Sergej Shafarenka authored and koddsson committed Sep 5, 2017
1 parent 8a88033 commit 95b237d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/chai-subset.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
if (typeof(eo) === 'object' && eo !== null && ao !== null) {
return compare(eo, ao);
}
if (typeof(eo) === 'function') {
return eo(ao);
}
return ao === eo;
});
}
Expand Down

0 comments on commit 95b237d

Please sign in to comment.