Skip to content

fix: toEqual throws error when comparing readonly properties#9575

Merged
SimenB merged 3 commits into
jestjs:masterfrom
doniyor2109:writable_properties_for_deepcylic_cop
Feb 16, 2020
Merged

fix: toEqual throws error when comparing readonly properties#9575
SimenB merged 3 commits into
jestjs:masterfrom
doniyor2109:writable_properties_for_deepcylic_cop

Conversation

@doniyor2109

Copy link
Copy Markdown
Contributor

Fixes #9531

@codecov-io

codecov-io commented Feb 15, 2020

Copy link
Copy Markdown

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

SimenB commented Feb 16, 2020

Copy link
Copy Markdown
Member

Thank you!

@jacek-rzrz

Copy link
Copy Markdown

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

gaearon commented Mar 24, 2020

Copy link
Copy Markdown
Contributor

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

@sebmarkbage

Copy link
Copy Markdown

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

@gaearon

gaearon commented Apr 2, 2020

Copy link
Copy Markdown
Contributor

Filed an issue for setters. #9745

@github-actions

Copy link
Copy Markdown

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