jestjs/jest

Jest should resolve its dependencies from its own location rather than rootDir

Ouverte

#5 913 ouverte le 3 avr. 2018

 (21 commentaires) (30 réactions) (0 personne assignée)TypeScript (6 653 forks)batch import
ConfirmedHelp WantedPinned

Métriques du dépôt

Stars
 (45 361 étoiles)
Métriques de merge PR
 (Merge moyen 11j 22h) (11 PRs mergées en 30 j)

Description

Create React App users bumped into this issue recently. A third party package started depending on jest-validate, and that caused npm to hoist jest-environment-node to the top of the app tree. Unfortunately, Jest resolves environment package from the project root instead of from its own Node module location so as a result, it loads the wrong (hoisted) jest-environment-node.

I think the jest package should resolve any own dependencies from its own location (just like Node resolution works) rather than from the project root folder.

Guide contributeur