Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NaN values? #72

Open
jedwards1211 opened this issue May 15, 2019 · 0 comments
Open

NaN values? #72

jedwards1211 opened this issue May 15, 2019 · 0 comments

Comments

@jedwards1211
Copy link

jedwards1211 commented May 15, 2019

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
       }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant