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

fix: toEqual throws error when comparing readonly properties #9575

Merged
merged 3 commits into from
Feb 16, 2020
Merged

fix: toEqual throws error when comparing readonly properties #9575

merged 3 commits into from
Feb 16, 2020

Conversation

doniyor2109
Copy link
Contributor

Fixes #9531

@codecov-io
Copy link

codecov-io commented Feb 15, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@9a36e7f). Click here to learn what that means.
The diff coverage is 80.14%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #9575   +/-   ##
=========================================
  Coverage          ?   65.03%           
=========================================
  Files             ?      286           
  Lines             ?    12142           
  Branches          ?     3009           
=========================================
  Hits              ?     7897           
  Misses            ?     3606           
  Partials          ?      639
Impacted Files Coverage Δ
packages/babel-plugin-jest-hoist/src/index.ts 0% <ø> (ø)
packages/jest-runner/src/testWorker.ts 0% <ø> (ø)
packages/pretty-format/src/collections.ts 98.48% <ø> (ø)
packages/jest-jasmine2/src/reporter.ts 59.52% <ø> (ø)
packages/jest-reporters/src/coverage_reporter.ts 51.21% <ø> (ø)
packages/diff-sequences/src/index.ts 100% <ø> (ø)
...circus/src/legacy-code-todo-rewrite/jestAdapter.ts 0% <ø> (ø)
packages/jest-validate/src/condition.ts 100% <ø> (ø)
packages/jest-util/src/clearLine.ts 0% <ø> (ø)
...es/jest-watcher/src/lib/formatTestNameByPattern.ts 84.21% <ø> (ø)
... and 108 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a36e7f...704100d. Read the comment docs.

@SimenB SimenB merged commit d4a10f7 into jestjs:master Feb 16, 2020
@SimenB
Copy link
Member

SimenB commented Feb 16, 2020

Thank you!

@jacek-rzrz
Copy link

We rely on Object.freeze in our tests a lot and are suffering from this bug. It's amazing to see it fixed, is there any chance there will be a release soon?

acdlite added a commit to acdlite/react that referenced this pull request Mar 24, 2020
There's a bug where `toEqual` throws when comparing readonly properties,
which affects our JSX matchers.

jestjs/jest#9575

The bug is fixed in master, but not yet released.

Until then, downgrading to 24.
@gaearon
Copy link
Contributor

gaearon commented Mar 24, 2020

Just a heads up we'll need to revert the upgrade and downgrade to 24 in the meantime.

@sebmarkbage
Copy link

What happens in this fix if the object has a setter that throws or causes a side-effect (e.g. logs)?

@gaearon
Copy link
Contributor

gaearon commented Apr 2, 2020

Filed an issue for setters. #9745

@github-actions
Copy link

This pull request 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

Successfully merging this pull request may close these issues.

Cannot assign to read only property 'props' of object '#<Object>' with React
7 participants