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

Array snapshots not serialized correctly when used with property matchers #10403

Closed
jimmydief opened this issue Aug 13, 2020 · 2 comments · Fixed by #10404
Closed

Array snapshots not serialized correctly when used with property matchers #10403

jimmydief opened this issue Aug 13, 2020 · 2 comments · Fixed by #10404

Comments

@jimmydief
Copy link
Contributor

jimmydief commented Aug 13, 2020

🐛 Bug Report

To Reproduce

Steps to reproduce the behavior: Clone https://github.com/jimmydief/jest-array-snapshot-issue and run npm test.

Expected behavior

The snapshot should look like this:

Array [
   Object {
     "name": "One",
   },
   Object {
     "name": "Two",
   },
   Object {
     "name": "Three",
   },
]

Instead, it looks like this:

Object {
   "0": Object {
     "name": "One",
   },
   "1": Object {
     "name": "Two",
   },
   "2": Object {
     "name": "Three",
   },
}

Link to repl or repo (highly encouraged)

https://github.com/jimmydief/jest-array-snapshot-issue

envinfo

node 12.16.0
jest 26.1.0

Seems like the fix is in jest-snapshot's deepMerge method, will put up a PR shortly.

@SimenB
Copy link
Member

SimenB commented Aug 20, 2020

https://github.com/facebook/jest/releases/tag/v26.4.1

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants