Updating the cheerio dependency separately due to issues with globally bumping it to version 1.0.0:
The enzyme library, which we use in many Jest tests, has pinned cheerio to 1.0.0-rc.3. This is because later releases of cheerio no longer export the lib folder, which enzyme relies on.
If we globally update cheerio to version 1.0.0, Jest tests running in jest-environment-jsdom fail with the error:
Cannot find module 'cheerio/lib/utils' from 'node_modules/enzyme/build/Utils.js'
To resolve this issue, I applied dependency resolution to ensure compatibility:
cheerio@1.0.0-rc.12 is still supported by enzyme@3.11.0 and passes our snyk check (1.0.0-rc.3 fails)
:robot: Jobs for this PR can be triggered through checkboxes. :construction:
:information_source: To trigger the CI, please tick the checkbox below :point_down:
- [ ] Click to trigger **kibana-pull-request** for this PR!
- [ ] Click to trigger **kibana-deploy-project-from-pr** for this PR!
Summary
Related to https://github.com/elastic/kibana/pull/200791
Updating the cheerio dependency separately due to issues with globally bumping it to version
1.0.0
:The enzyme library, which we use in many Jest tests, has pinned cheerio to 1.0.0-rc.3. This is because later releases of cheerio no longer export the lib folder, which enzyme relies on.
If we globally update cheerio to version
1.0.0
, Jest tests running injest-environment-jsdom
fail with the error:To resolve this issue, I applied dependency resolution to ensure compatibility:
cheerio@1.0.0-rc.12
is still supported byenzyme@3.11.0
and passes our snyk check (1.0.0-rc.3
fails)I believe it is a temporary solution because
enzyme
will be removed with future React updates.