-
-
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] Ensure recursive calls to displayNameOfNode uses the adapter's version of the method #2482
Conversation
…eOfNode` uses the adapter's version of the method Fixes enzymejs#2481
@@ -886,13 +887,13 @@ class ReactSixteenAdapter extends EnzymeAdapter { | |||
case ContextProvider || NaN: return 'ContextProvider'; | |||
case Memo || NaN: { | |||
const nodeName = displayNameOfNode(node); |
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.
One thing that wasn't clear to me was when/why we should use the adapter here or not.
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.
i think if we did, it would be an infinite loop.
Codecov Report
@@ Coverage Diff @@
## master #2482 +/- ##
=======================================
Coverage 96.04% 96.05%
=======================================
Files 49 49
Lines 3924 3925 +1
Branches 1102 1102
=======================================
+ Hits 3769 3770 +1
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.
Thanks, this seems great.
@@ -886,13 +887,13 @@ class ReactSixteenAdapter extends EnzymeAdapter { | |||
case ContextProvider || NaN: return 'ContextProvider'; | |||
case Memo || NaN: { | |||
const nodeName = displayNameOfNode(node); |
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.
i think if we did, it would be an infinite loop.
this
version of the function- [fix] `.setContext()`: calls cWRP (#2476) - [fix] Ensure recursive calls to `displayNameOfNode` uses the adapter's version of the method (#2482) - [deps] update `object.assign`, `object.values`, `enzyme-adapter-utils` - [dev deps] update `eslint`, `eslint-config-airbnb`, `eslint-config-airbnb-base`, `eslint-plugin-import`, `eslint-plugin-jsx-a11y`, `eslint-plugin-react`, `eslint-plugin-react-hooks`, `babel-plugin-add-module-exports`, `@babel/cli`, `@babel/core`, `@babel/node`, `@babel/register`, `babel-loader`
Fixes #2481
This is my first contribution to enzyme so happy to update/modify this PR as needed.