jestjs/jest

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

開放

#5,913 建立於 2018年4月3日

 (21 則留言) (30 個反應) (0 位負責人)TypeScript (6,653 個分叉)batch import
ConfirmedHelp WantedPinned

倉庫指標

星標
 (45,361 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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.

貢獻者指南