-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Labels
Description
🐛 Bug Report
require.resolve
with options seems had different result in some case
require.resolve('foo/node_modules/bar', {paths: [process.cwd()]});
result differently with require.resolve
from Node.js
To Reproduce
Steps to reproduce the behavior:
A reproduction repo https://github.com/fisker/jest-require-resolve-bug , see readme.md
in that repo.
Expected behavior
Should try resolve foo
package in node_modules
, instead of returning foo/node_modules/bar/index.js
file
Link to repl or repo (highly encouraged)
reproduction repo
https://github.com/fisker/jest-require-resolve-bug
issue found on this PR on prettier
envinfo
System:
OS: Windows 10 10.0.18362
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Binaries:
Node: 13.5.0
Yarn: 1.21.1
npm: 6.13.4
npmPackages:
jest: 25.1.0 => 25.1.0