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

Replace identity equality with Object.is in toBe matcher #4917

Merged
merged 1 commit into from Nov 20, 2017

Conversation

Projects
None yet
5 participants
@mkubilayk
Copy link
Contributor

mkubilayk commented Nov 19, 2017

Summary

This replaces the strict equality (===) check with Object.is in the toBe matcher. Object.is works exactly the same as triple equals except:

> Object.is(NaN, NaN)
true
> NaN === NaN
false
> Object.is(-0, +0)
false
> -0 === +0
true

Hence, this allows us to fix #4907.

Test plan

Added two tests for toBe matcher. I couldn't test the docs due to #4911 and #4912, but changes are trivial.

@mkubilayk mkubilayk force-pushed the mkubilayk:tobe-nan branch from ed8d638 to 2e9fd3d Nov 19, 2017

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Nov 19, 2017

Codecov Report

Merging #4917 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4917   +/-   ##
=======================================
  Coverage   59.98%   59.98%           
=======================================
  Files         198      198           
  Lines        6563     6563           
  Branches        4        4           
=======================================
  Hits         3937     3937           
  Misses       2626     2626

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9303ecf...2e9fd3d. Read the comment docs.

@cpojer

This comment has been minimized.

Copy link
Contributor

cpojer commented Nov 20, 2017

This is great! Thank you so much.

@cpojer cpojer merged commit 57efef0 into facebook:master Nov 20, 2017

5 checks passed

ci/circleci: test-and-deploy-website Your tests passed on CircleCI!
Details
ci/circleci: test-browser Your tests passed on CircleCI!
Details
ci/circleci: test-node-6 Your tests passed on CircleCI!
Details
ci/circleci: test-node-8 Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@mkubilayk mkubilayk deleted the mkubilayk:tobe-nan branch Nov 20, 2017

@SimenB

This comment has been minimized.

Copy link
Collaborator

SimenB commented Dec 9, 2017

This needs an entry in the changelog (in general, all should be there, but this in particular is a breaking change, so should definitely be there). @mkubilayk wanna send a PR for it?

@mkubilayk

This comment has been minimized.

Copy link
Contributor

mkubilayk commented Dec 9, 2017

@SimenB sure, will send it today.

@mkubilayk mkubilayk referenced this pull request Dec 9, 2017

Merged

Update changelog #5043

@mkubilayk

This comment has been minimized.

Copy link
Contributor

mkubilayk commented Dec 9, 2017

@SimenB #5043.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment