-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
absolute paths in moduleDirectories
are invalid in Windows OS
#5396
Comments
warren-bank
added a commit
to warren-bank/fork-jest
that referenced
this issue
Jan 26, 2018
…nder Windows OS
moduleDirectories
are invalid under Windows OSmoduleDirectories
are invalid under Windows OS
moduleDirectories
are invalid under Windows OSmoduleDirectories
are invalid in Windows OS
warren-bank
added a commit
to warren-bank/fork-jest
that referenced
this issue
Jan 26, 2018
For a concrete example that's fairly minimal: git clone "https://github.com/warren-bank/react-redux-bindings.git"
cd "react-redux-bindings"
npm install
cd "tests"
npm install
npm run test Background:
|
warren-bank
added a commit
to warren-bank/fork-jest
that referenced
this issue
Jan 28, 2018
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
https://github.com/facebook/jest
https://github.com/facebook/jest/tree/master/packages/jest-resolve
https://github.com/facebook/jest/blob/master/packages/jest-resolve/src/node_modules_paths.js
error:
moduleDirectories
are invalid in Windows OSevidence:
file:
packages/jest-resolve/src/node_modules_paths.js
line: 54
insert code:
console.log('dirs:', JSON.stringify(dirs, null, 2))
patch v1:
file:
packages/jest-resolve/src/node_modules_paths.js
line: 50
original code:
return path.join(prefix, aPath, moduleDir);
modified code:
return path.isAbsolute(moduleDir) ? moduleDir : path.join(prefix, aPath, moduleDir);
effects:
dirs.length
will not changedirs
will containpaths.length
duplicates of each absolute path inmodules
patch v2:
file:
packages/jest-resolve/src/node_modules_paths.js
lines: 47 - 53
original code:
modified code:
effects:
modules
is only returned for a particular iteration ofpaths.reduce()
dirs
is then filtered to remove these null valuesdirs.length
will be reduced, which could slightly boost performanceThe text was updated successfully, but these errors were encountered: