Since NaN !== NaN, a NaN value causes containSubset to fail, and the error message is confusing because it looks like it's erroneously complaining about missing fields...
Maybe we should use Object.is or equivalent?
expect({foo: NaN, bar: 'baz'}).to.containSubset({foo: NaN})
AssertionError: expected { foo: NaN, bar: 'baz' } to contain subset { foo: NaN }
+ expected - actual
{
- "bar": "baz"
"foo": NaN
}
Since
NaN !== NaN
, aNaN
value causescontainSubset
to fail, and the error message is confusing because it looks like it's erroneously complaining about missing fields...Maybe we should use
Object.is
or equivalent?