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

expect/jest-matcher-utils: Improve report when assertion fails, part 5 #7557

Merged
merged 14 commits into from
Jan 11, 2019
Merged
Show file tree
Hide file tree
Changes from 8 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 @@ -34,6 +34,7 @@
- `[jest-validate]` Add syntax to validate multiple permitted types ([#7207](https://github.com/facebook/jest/pull/7207))
- `[jest-config]` Accept an array as as well as a string for `testRegex`([#7209]https://github.com/facebook/jest/pull/7209))
- `[expect/jest-matcher-utils]` Improve report when assertion fails, part 4 ([#7241](https://github.com/facebook/jest/pull/7241))
- `[expect/jest-matcher-utils]` Improve report when assertion fails, part 5 ([#7557](https://github.com/facebook/jest/pull/7557))
- `[expect]` Check constructor equality in .toStrictEqual() ([#7005](https://github.com/facebook/jest/pull/7005))
- `[jest-util]` Add `jest.getTimerCount()` to get the count of scheduled fake timers ([#7285](https://github.com/facebook/jest/pull/7285))
- `[jest-config]` Add `dependencyExtractor` option to use a custom module to extract dependencies from files ([#7313](https://github.com/facebook/jest/pull/7313), [#7349](https://github.com/facebook/jest/pull/7349), [#7350](https://github.com/facebook/jest/pull/7350))
Expand Down
10 changes: 6 additions & 4 deletions e2e/__tests__/__snapshots__/failures.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,9 @@ exports[`works with async failures 1`] = `

expect(received).rejects.toEqual()

Expected received Promise to reject, instead it resolved to value
{\\"foo\\": \\"bar\\"}
Received promise resolved instead of rejected

Received promise resolved to value: {\\"foo\\": \\"bar\\"}
pedrottimark marked this conversation as resolved.
Show resolved Hide resolved

16 |
17 | test('expect reject', () =>
Expand All @@ -377,8 +378,9 @@ exports[`works with async failures 1`] = `

expect(received).resolves.toEqual()

Expected received Promise to resolve, instead it rejected to value
{\\"foo\\": \\"bar\\"}
Received promise rejected instead of resolved

Received promise rejected to value: {\\"foo\\": \\"bar\\"}

19 |
20 | test('expect resolve', () =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`.hasAssertions() throws if expected is not undefined 1`] = `
"<dim>expect(</><red>received</><dim>)[.not].hasAssertions(</><dim>)</>
"<dim>expect(</><red>received</><dim>)[.not].hasAssertions()</>

<bold>Matcher error</>: <green>expected</> value must be omitted or undefined
<bold>Matcher error</>: this matcher must not have an expected argument

Expected has type: number
Expected has value: <green>2</>"
Expand Down
Loading