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

Asymmetric matcher objectContaining mutates arguments #10717

Closed
kylebjordahl opened this issue Oct 26, 2020 · 2 comments
Closed

Asymmetric matcher objectContaining mutates arguments #10717

kylebjordahl opened this issue Oct 26, 2020 · 2 comments

Comments

@kylebjordahl
Copy link

🐛 Bug Report

When using a local variable as an argument to an objectContaining asymmetric matcher, the variable is mutated in the containing scope.

To Reproduce

Steps to reproduce the behavior: see example repl.it

Expected behavior

Asymmetric matchers should not mutate their input arguments.

Link to repl or repo (highly encouraged)

https://repl.it/repls/CylindricalTenderDemand#objectContaining-mutates.test.js

envinfo

System:
    OS: macOS 10.15.6
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Binaries:
    Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
  npmPackages:
    jest: ^26.6.1 => 26.6.1 
@kylebjordahl
Copy link
Author

kylebjordahl commented Oct 26, 2020

Just noticed that #10508 is on the release notes for 26.6.1, I'd hazard a guess it's related to that...

EDIT: and just noticed #10689. Closing in favor of that

@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

No branches or pull requests

1 participant