-
-
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
[Bug]: toStrictEquals incorrectly compares class instances with getters that access private fields #13535
Comments
On further investigation I suspect that getters of classes are generally not considered on class instances. Otherwise getters of simple objects (e.g. I think the cause of this issue is the key enumeration code: https://github.com/facebook/jest/blob/54ce1053aa462cd745127ac41d571d812c268580/packages/expect-utils/src/jasmineUtils.ts#L205-L217
|
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
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. |
Version
29.2.2
Steps to reproduce
Execute the following test that fails:
with the following jest config
Also see stackblitz: https://stackblitz.com/edit/node-z2xset?file=index.spec.js
Expected behavior
I expect that the test above is successful.
Actual behavior
The test fails.
Additional context
This issue might be somehow related to the follwing issues, but I am not 100% sure as there are errors thrown in those issues.
Environment
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Binaries: Node: 16.14.2 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 7.17.0 - /usr/local/bin/npm npmPackages: jest: 29.2.2 => 29.2.2
The text was updated successfully, but these errors were encountered: