Skip to content

Commit

Permalink
expect: Improve report when matcher fails, part 16 (#8306)
Browse files Browse the repository at this point in the history
* expect: Improve report when matcher fails, part 16

* Update CHANGELOG.md

* Replace noun with verb: serializes to the same string
  • Loading branch information
pedrottimark authored Apr 13, 2019
1 parent 1f280d8 commit c7bcefb
Show file tree
Hide file tree
Showing 7 changed files with 313 additions and 338 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Features

- `[expect]` Improve report when matcher fails, part 15 ([#8281](https://github.com/facebook/jest/pull/8281))
- `[expect]` Improve report when matcher fails, part 16 ([#8306](https://github.com/facebook/jest/pull/8306))
- `[jest-runner]` Pass docblock pragmas to TestEnvironment constructor ([#8320](https://github.com/facebook/jest/pull/8320))

### Fixes
Expand Down
10 changes: 3 additions & 7 deletions e2e/__tests__/__snapshots__/failures.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ FAIL __tests__/testMacro.test.js
● use some imported macro to make assertion
expect(received).toEqual(expected)
expect(received).toEqual(expected) // deep equality
Expected: 2
Received: 1
Expand All @@ -286,9 +286,7 @@ FAIL __tests__/asyncFailures.test.js
● resolve, but fail
expect(received).toEqual(expected)
Difference:
expect(received).resolves.toEqual(expected) // deep equality
- Expected
+ Received
Expand All @@ -310,9 +308,7 @@ FAIL __tests__/asyncFailures.test.js
● reject, but fail
expect(received).toEqual(expected)
Difference:
expect(received).rejects.toEqual(expected) // deep equality
- Expected
+ Received
Expand Down
16 changes: 4 additions & 12 deletions packages/expect/src/__tests__/__snapshots__/extend.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`defines asymmetric unary matchers 1`] = `
"<dim>expect(</><red>received</><dim>).toEqual(</><green>expected</><dim>)</>
Difference:
"<dim>expect(</><red>received</><dim>).</>toEqual<dim>(</><green>expected</><dim>) // deep equality</>
<green>- Expected</>
<red>+ Received</>
Expand All @@ -15,9 +13,7 @@ Difference:
`;
exports[`defines asymmetric unary matchers that can be prefixed by not 1`] = `
"<dim>expect(</><red>received</><dim>).toEqual(</><green>expected</><dim>)</>
Difference:
"<dim>expect(</><red>received</><dim>).</>toEqual<dim>(</><green>expected</><dim>) // deep equality</>
<green>- Expected</>
<red>+ Received</>
Expand All @@ -29,9 +25,7 @@ Difference:
`;
exports[`defines asymmetric variadic matchers 1`] = `
"<dim>expect(</><red>received</><dim>).toEqual(</><green>expected</><dim>)</>
Difference:
"<dim>expect(</><red>received</><dim>).</>toEqual<dim>(</><green>expected</><dim>) // deep equality</>
<green>- Expected</>
<red>+ Received</>
Expand All @@ -43,9 +37,7 @@ Difference:
`;
exports[`defines asymmetric variadic matchers that can be prefixed by not 1`] = `
"<dim>expect(</><red>received</><dim>).toEqual(</><green>expected</><dim>)</>
Difference:
"<dim>expect(</><red>received</><dim>).</>toEqual<dim>(</><green>expected</><dim>) // deep equality</>
<green>- Expected</>
<red>+ Received</>
Expand Down
Loading

0 comments on commit c7bcefb

Please sign in to comment.