enzymejs / enzyme-matchers

Jasmine/Jest assertions for enzyme
MIT License
892 stars 116 forks source link

Make jest-environment-jsdom a peerDependency in jest-environment-enzyme #343

Open Methuselah96 opened 4 years ago

Methuselah96 commented 4 years ago

This increases flexibility for developers using this package. For example, I've been waiting for a couple months to upgrade to Jest 25 (see https://github.com/FormidableLabs/enzyme-matchers/issues/334). If this were a peer dependency, then I could have upgraded right away and it would have just automatically used the new version of jest-environment-jsdom.

ljharb commented 4 years ago

It could still not have been upgraded right away - peerdeps are strict requirements, and if npm ls does not exit zero, your dep graph is invalid and you can’t rely on anything working. npm 7 will fail installs if your peer deps are invalid.

That said, it should indeed be a peer dep.

Methuselah96 commented 4 years ago

@ljharb jest was not in the devDependencies of jest-enzyme, so I was following the precedent set there. I'm fine with adding test dependencies to devDependencies for individual packages, but it looks like we've relied on them being installed as a dev dependency on the monorepo up to this point, so I think that should be a more comprehensive change.

Whoaa512 commented 4 years ago

What's the status of this?