Closed sgilroy closed 8 years ago
Yup, I've put your tests in PR #22 , will try to fix that in next few days.
@sgilroy please review) #22
Looks like an effective solution to me, though you may also want to consider revising the way to you test for equality to resolve other potential failures. The algorithm behind isEqual in lodash might be useful. Perhaps you could use _.isEqual()
for cases where an expected value is an object that has no keys. You may want to also (or instead) update the documentation to explain how the containsSubset
test is implemented, and how it could fail.
I like the solution, not a fan of _.isEqual. I personally prefer the simple, self-contained solution.
fixed in #22
The way that objects are evaluated for equality fails for dates, because Object.keys(new Date()) returns an empty array (a Date has no keys).
Test to demonstrate the failure: