Open robaca opened 8 years ago
Is that ok if we provide a stricShallowDeepEquall the same was as http://chaijs.com/api/assert/#method_strictequal ?
That would be great
The default chai functions equal
and deep.equal
seem to be strict by default
that's not what the documentation says http://chaijs.com/api/assert/#method_equal nor the code https://github.com/chaijs/chai/blob/387dca2320751f3e13474ea12c595b4b6ce59d49/lib/chai/interface/assert.js#L108-L133
ok. That's right for assert, but not for expect: http://chaijs.com/api/bdd/#method_equal
wow that is unexpected D:
@michelsalib, would you consider accepting a PR that aligns "equality strictness" of shallowDeepEqual
with equal
, i.e. when used with assert
it's based on ==
, while when used with expect
it's based on ===
.
Examples:
assert.shallowDeepEqual({ a: 1 }, { a: '1' })
should pass.expect({ a: 1}).shallowDeepEqual({ a: '1' })
should fail.Or perhaps you have other ideas on how to introduce more strictness? Thanks in advance for your help! :pray:
shallowDeepEqual
compares properties using '==', which leads to equality when comparing strings'9'
to an equal number9
.