-
Notifications
You must be signed in to change notification settings - Fork 801
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
Enzyme fails to return text or html when shallow rendering #897
Comments
Quite strange - outside of webpack dev env, ie without |
That would be because I have |
Now I see. |
I understand. I found a workaround for my issues with v3, so I at least have a working solution for now. v4's The v4 workaround is doing a full |
Theoretically - is RHL working ok with mount, it shall work with shallow. Theoretically. |
If you are reporting a bug or having an issue setting up React Hot Loader, please fill in below. For feature requests, feel free to remove this template entirely.
Description
What you are reporting:
When shallow rendering in enzyme,
text
andhtml
functions return null strings.I tried a few things when reproducing. First, this works fine in v3. Merely upgrading to v4 without changing any other code is can cause this issue. I tried removing all React Hot Loader code and nothing changed.
If I do a
mount
instead ofshallow
render, it works fine which makes me think something's getting rendered in between.Expected behavior
What you think should happen:
wrapper.text()
should have the valuehi
and any other text in the component.Actual behavior
What actually happens:
wrapper.text()
returns a null string''
.Environment
React Hot Loader version: 4.0.0
Run these commands in the project folder and fill in their results:
node -v
: v8.9.4yarn-v
: 1.3.2Then, specify:
Reproducible Demo
.babelrc
entrypoint.js
The text was updated successfully, but these errors were encountered: