Skip to content

Commit

Permalink
do not claim that -0 and 0 have no visual difference
Browse files Browse the repository at this point in the history
  • Loading branch information
jeysal committed Jan 20, 2019
1 parent 198c770 commit 643beb1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

### Fixes

- `[jest-diff]` Do not claim that `-0` and `0` have no visual difference ([#7605](https://github.com/facebook/jest/pull/7605))
- `[jest-mock]` Fix automock for numeric function names ([#7653](https://github.com/facebook/jest/pull/7653))
- `[jest-config]` Ensure `existsSync` is only called with a string parameter ([#7607](https://github.com/facebook/jest/pull/7607))
- `[expect]` `toStrictEqual` considers sparseness of arrays. ([#7591](https://github.com/facebook/jest/pull/7591))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,7 @@ exports[`.toBe() fails for: -0 and 0 1`] = `
"<dim>expect(</><red>received</><dim>).toBe(</><green>expected</><dim>) // Object.is equality</>

Expected: <green>0</>
Received: <red>-0</>

Difference:

<dim>Compared values have no visual difference.</>"
Received: <red>-0</>"
`;

exports[`.toBe() fails for: 1 and 2 1`] = `
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-diff/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const FALLBACK_FORMAT_OPTIONS_0 = {...FALLBACK_FORMAT_OPTIONS, indent: 0};
// Generate a string that will highlight the difference between two values
// with green and red. (similar to how github does code diffing)
function diff(a: any, b: any, options: ?DiffOptions): ?string {
if (a === b) {
if (Object.is(a, b)) {
return NO_DIFF_MESSAGE;
}

Expand Down

0 comments on commit 643beb1

Please sign in to comment.