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

Update toEqual failure message #7325

Merged
merged 8 commits into from
Jan 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
- `[jest-config]` Use strings instead of `RegExp` instances in normalized configuration ([#7251](https://github.com/facebook/jest/pull/7251))
- `[jest-circus]` Make sure to display real duration even if time is mocked ([#7264](https://github.com/facebook/jest/pull/7264))
- `[expect]` Improves the failing message for `toStrictEqual` matcher. ([#7224](https://github.com/facebook/jest/pull/7224))
- `[expect]` Improves the failing message for `toEqual` matcher. ([#7325](https://github.com/facebook/jest/pull/7325))
- `[jest-resolve]` Fix not being able to resolve path to mapped file with custom platform ([#7312](https://github.com/facebook/jest/pull/7312))
- `[jest-message-util]` Improve parsing of error messages for unusually formatted stack traces ([#7319](https://github.com/facebook/jest/pull/7319))
- `[jest-runtime]` Ensure error message text is not lost on errors with code frames ([#7319](https://github.com/facebook/jest/pull/7319))
Expand Down
16 changes: 2 additions & 14 deletions e2e/__tests__/__snapshots__/failures.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,8 @@ exports[`works with assertions in separate files 1`] = `

expect(received).toEqual(expected)

Expected value to equal:
2
Received:
1
Expected: 2
Received: 1

10 |
11 | module.exports = (one: any, two: any) => {
Expand All @@ -302,11 +300,6 @@ exports[`works with async failures 1`] = `

expect(received).toEqual(expected)

Expected value to equal:
{\\"baz\\": \\"bar\\"}
Received:
{\\"foo\\": \\"bar\\"}

Difference:

- Expected
Expand All @@ -331,11 +324,6 @@ exports[`works with async failures 1`] = `

expect(received).toEqual(expected)

Expected value to equal:
{\\"baz\\": \\"bar\\"}
Received:
{\\"foo\\": \\"bar\\"}

Difference:

- Expected
Expand Down
20 changes: 0 additions & 20 deletions packages/expect/src/__tests__/__snapshots__/extend.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
exports[`defines asymmetric unary matchers 1`] = `
"<dim>expect(</><red>received</><dim>).toEqual(</><green>expected</><dim>)</>

Expected value to equal:
<green>{\\"value\\": toBeDivisibleBy<2>}</>
Received:
<red>{\\"value\\": 3}</>

Difference:

<green>- Expected</>
Expand All @@ -22,11 +17,6 @@ Difference:
exports[`defines asymmetric unary matchers that can be prefixed by not 1`] = `
"<dim>expect(</><red>received</><dim>).toEqual(</><green>expected</><dim>)</>

Expected value to equal:
<green>{\\"value\\": not.toBeDivisibleBy<2>}</>
Received:
<red>{\\"value\\": 2}</>

Difference:

<green>- Expected</>
Expand All @@ -41,11 +31,6 @@ Difference:
exports[`defines asymmetric variadic matchers 1`] = `
"<dim>expect(</><red>received</><dim>).toEqual(</><green>expected</><dim>)</>

Expected value to equal:
<green>{\\"value\\": toBeWithinRange<4, 11>}</>
Received:
<red>{\\"value\\": 3}</>

Difference:

<green>- Expected</>
Expand All @@ -60,11 +45,6 @@ Difference:
exports[`defines asymmetric variadic matchers that can be prefixed by not 1`] = `
"<dim>expect(</><red>received</><dim>).toEqual(</><green>expected</><dim>)</>

Expected value to equal:
<green>{\\"value\\": not.toBeWithinRange<1, 3>}</>
Received:
<red>{\\"value\\": 2}</>

Difference:

<green>- Expected</>
Expand Down
Loading