enzymejs / enzyme

JavaScript Testing utilities for React
https://enzymejs.github.io/enzyme/
MIT License
19.95k stars 2.01k forks source link

Enzyme intended to be pinned to "cheerio 1.0.0-rc-3" but latest version installed #2517

Closed alasdairhurst closed 3 years ago

alasdairhurst commented 3 years ago

Current behavior

https://github.com/enzymejs/enzyme/blob/master/packages/enzyme/package.json#L42 As seen in the link above, enzyme is supposed to depend on cheerio 1.0.0-rc3. Not that it's an issue, but it's obviously intentionally pinned to that specific version. (wouldn't want to pick up any prerelease breaking changes). Unfortunately it looks like the latest is being picked up regardless. Just hit an issue after cheerio published 1.0.0-rc7

Module not found: Error: Can't resolve 'cheerio/lib/utils' in '/builds/amplify/api-builder/node_modules/enzyme/build'

They have very quickly fixed this issue, but it made it clear that something unintentional is happening in enzme for it to get installed as a dependency ;)

Expected behavior

cheerio 1.0.0-rc3 gets installed as a dependency of enzme (or a later version, but pinned)

Your environment

Not really applicable but will provide some details

Node/NPM

Node: 12.18.3 NPM: 6.14.12

API

Version

library version
enzyme 3.11.0
react 15 (n/a)
react-dom n/a
react-test-renderer n/a
adapter (below) 1.4.3

Adapter

alasdairhurst commented 3 years ago

Wasn't expecting there to be an issue for an older version of cheerio, looks like there hasn't been an enzyme release since the fix was made here 5 months back. Closed.

ljharb commented 3 years ago

Indeed. Duplicate of #2516.

Temporary workaround is to pin cheerio in your own devDeps.