-
Notifications
You must be signed in to change notification settings - Fork 22
Comparing two different types of values. Expected array but received object #111
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
Comments
I am also experiencing this issue. It happens whenever you are using snapshotDiff with elements that are fragments. |
alistairjcbrown
added a commit
to alistairjcbrown/snapshot-diff
that referenced
this issue
Apr 26, 2020
With the React serializer updated to use `prettyFormat`, this now supports diffing React fragments when comparing a single element to multiple elements returned. Adding test to confirm output. Fixes jest-community#111
thymikee
pushed a commit
that referenced
this issue
May 6, 2020
* Output jest mock function names in snapshot diff Use same serializers as jest-snapshot when serializing react components rendered by react-test-renderer. Fixes #106 * Add test to show output for React fragments With the React serializer updated to use `prettyFormat`, this now supports diffing React fragments when comparing a single element to multiple elements returned. Adding test to confirm output. Fixes #111 * Use jest-snapshot serializers for diff annotations Makes use of the same serializers used for printing, in the react serializer diff options which set up the A and B diff annotations.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've encountered an issue where taking a snapshot diff doesn't produce the expected output. I've outlined a simplistic example to reproduce below:
The above error is produced by
diffStrings
and occured when we compare an array with an object.In this case, the call is :
A solution to this issue could be to wrap the object in an array.
The text was updated successfully, but these errors were encountered: