-
-
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
Cannot assign to read only property 'props' of object '#<Object>' with React #9531
Comments
/cc @pedrottimark |
downgrade jest to 24.9 to avoid jestjs/jest#9531
downgrade jest to 24.9 to avoid jestjs/jest#9531
I am running into this problem as well. It seems quite easy to reproduce: const x = { foo: {} };
Object.freeze(x);
expect({ foo: { bar: 1 } }).toEqual(x); The expect statement produces the error This issue occurs on Jest >= |
downgrade jest to 24.9 to avoid jestjs/jest#9531
downgrade jest to 24.9 to avoid jestjs/jest#9531
I am also running into this bug where I have a frozen object, and comparing it against one that I want it to be equal to, using the toEqual matcher. Is it actually fixed?
UPDATE: If I rename the allergies-variable I have to something else, it works properly. I do not understand this at all. |
Getting this issue too. Downgrading to jest 24.x reveals a normal .isEqual failure, but with 25.x we get |
I have created a minimal reproducing test case: test('frozen object comparison', () => {
expect(Object.freeze({
a: {},
b: {},
})).toEqual({
a: {},
});
}); Error:
|
Also having this problem. Until it's properly fixed this solves it. reduxjs/redux-toolkit#424 (comment) |
It looks like there's a fix in master but it's not been released yet. |
25.2.0 published |
This isn't a sufficient fix. I filed #9745. |
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
After upgrading to jest 25.x.x, when comparing 2 different React Components with
there's an TypeError instead of a report of the differences between the components.
To Reproduce
Expected behavior
It works fine in jest 24.9
Link to repl or repo (highly encouraged)
envinfo
The text was updated successfully, but these errors were encountered: