jestjs/jest

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

Open

#5.913 aberto em 3 de abr. de 2018

Ver no GitHub
 (21 comments) (30 reactions) (0 assignees)TypeScript (6.653 forks)batch import
ConfirmedHelp WantedPinned

Métricas do repositório

Stars
 (45.361 stars)
Métricas de merge de PR
 (Mesclagem média 11d 22h) (11 fundiu PRs em 30d)

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.

Guia do colaborador