-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Omit non-enumerable, symbolic members in snapshots #7443
Comments
For some background, at first glance it seems that snapshots are accidentally taking non-enumerable, symbolic members into account. This was originally the case for I am willing to attempt a PR to achieve the mentioned behavior |
It might help the large jsdom snapshots as well... /cc @pedrottimark @rickhanlonii @thymikee thoughts? |
Suggested alternative title for this issue: Omit non-enumerable, symbolic members in snapshots |
Since we've changed this behavior for |
@austinalameda thanks for reporting and thanks for dropping in with the info @mweststrate If we're going to do it, let's do it now before the next major Another option (either in the short term or long term) may be to add a custom serializer |
Yes to making I will make pull request. |
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. |
🐛 Bug Report
When upgrading from MobX 4.3.0 to 5.6.0, new snapshot information is created using jest
This information is largely extraneous, and when added typically triples the size of the snapshot file (best case) and sometimes grows file by 10x (worst case)
To Reproduce
Steps to reproduce the behavior: Using mobx and mobx-react, create an
@observer
react component that receives props including an@observable
object. Write a test file that mounts this component and takes a snapshotExpected behavior
according to @mweststrate of MobX:
the problem is that it should ignore non-enumerable (symbolic) members. It was fixed a while ago for toEqual, but not yet for snapshots
link to mobx issue
Run
npx envinfo --preset jest
The text was updated successfully, but these errors were encountered: