Closed el-ethan closed 3 years ago
enzyme is pinned now to v1.0.0-rc.3
of cheerio; altho it hasn't been released yet. I'd suggest adding that as an explicit dev dep, using =
.
@ljharb thank you so much for the quick response! I added "cheerio": "1.0.0-rc.3"
to my devDependencies
as suggested, and this resolved the issue. Thank you!
This was fixed in https://github.com/enzymejs/enzyme/commit/cafdb2b86ed8865527cdd6ae31c42593d3728ceb and will be released in the next enzyme version.
Current behavior
When I call the
render()
function on a basic React component, it gives me the following errror:Here is an example test that fails with minimal code:
which raises the following error:
I believe the issue lies in
cheerio@1.0.0-rc.6
because, in addition to the stacktrace pointing tocheerio
, I have found that withcheerio@1.0.0-rc.5
, and the same test code, my test passes without error. I discovered this because I have a branch with apackage-lock.json
that locks incheerio@1.0.0-rc.5
. If I removenode_modules
and install with that package lock, then I do not get the error (even withenzyme@3.11.0
). However, if I donpm install enzyme@latest
, my version of enzyme does not change (since I had already been using the latest), but mycheerio
gets updated tocheerio@1.0.0-rc.6
, and I get the error.Expected behavior
It should render the component without error.
Your environment
API
Version
Adapter
Please let me know if I can provide any more info, or if you think I should report this issue elsewhere. Thank you!