-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 simulateError()
on Memo component
#2525
Conversation
simulateError()
on Memo component
Codecov Report
@@ Coverage Diff @@
## master #2525 +/- ##
=======================================
Coverage 96.31% 96.31%
=======================================
Files 49 49
Lines 4204 4207 +3
Branches 1130 1130
=======================================
+ Hits 4049 4052 +3
Misses 155 155
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great; tests fail without your fix, and pass with them. Thanks!
packages/enzyme-test-suite/test/shared/lifecycles/componentDidCatch.jsx
Outdated
Show resolved
Hide resolved
519db6f
to
8c55734
Compare
From enzymejs/enzyme#2525 Co-Authored-By: Henry Q. Dineen <[email protected]>
From enzymejs/enzyme#2525 Co-Authored-By: Henry Q. Dineen <[email protected]>
- [fix] `isEmptyRender`: properly detect memoized SFCs returning null - [fix] avoid a crash with lazy components - [fix] fix `simulateError()` on Memo component (#2525) - [babel] add `babel-plugin-add-module-exports` and fully use ESM syntax - [deps] update `enzyme-shallow-equal`, `enzyme-adapter-utils`, `object.assign`, `object.values`, `prop-types` - [meta] use `npmignore` to autogenerate - [eslint] switch to `@babel/eslint-parser`, fix lintingan npmignore file - [dev deps] update `@babel/cli`, `@babel/core`, `eslint`, `eslint-config-airbnb`, `eslint-config-airbnb-base`, `eslint-plugin-import`, `eslint-plugin-jsx-a11y`, `eslint-plugin-markdown`, `eslint-plugin-react`, `eslint-plugin-react-hooks` - [dev deps] update `safe-publish-latest`; use `prepublishOnly`
We are seeing
TypeError: Cannot read property 'displayNameOfNode' of undefined
errors and I believe I tracked it down to a regression introduced in #2482. ThedisplayNameOfNode()
method now referencesthis
but withsimulateError()
it ends up being called unbound. My fix is to just always bindadapter.displayNameOfNode
sothis
is alwaysadapter
.Thanks!