-
-
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
expect.objectContaining(...) mutates properties of the argument #10689
Comments
This is the PR that seems to have broken it. Looks like we're mutating the object? this.sample[property] = objectContaining(
this.sample[property] as Record<string, unknown>,
); |
This comment has been minimized.
This comment has been minimized.
Thank you all for addressing this so quickly! Do you know when I can expect a release that contains this fix? |
today or tomorrow, need to fix #10690 first |
fyi: for those waiting for a fix, for now, you can pin the expect package in the package.json : "resolutions": {
"expect": "26.6.0"
} |
Hoping to have a fix for #10690 this weekend, but if not I'll cut a release without it |
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 react-scripts version 3.4.3 to version 4.0.0, jest was also upgraded. Tests that were behaving reasonably began failing. Upon closer inspection, I discovered that
expect.objectContaining(...)
was mutating properties of the argument! For example, this code would fail in the indicated location:Expected behavior
The argument to
objectContaining(...)
is not mutated.Link to repl or repo (highly encouraged)
Note: this link contains the very code described above 😄
https://repl.it/repls/TomatoVengefulAngles#example.test.js
The text was updated successfully, but these errors were encountered: