-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Use NODE_PATH env var in jest config #1272
Conversation
@@ -38,6 +38,7 @@ module.exports = (resolve, rootDir, isEjecting) => { | |||
transformIgnorePatterns: [ | |||
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$' | |||
], | |||
moduleDirectories: ['node_modules', process.env.NODE_PATH].filter(dir => dir), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we exclude absolute paths here like we do in env.js
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean from process.env.NODE_PATH
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. See #1194 for context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, of course!
ec49e72
to
0ac094e
Compare
0ac094e
to
9929017
Compare
Hmm, this makes me confused. Isn't Jest already supposed to handle Also, I think this file would execute after ejecting, causing directory names to get hardcoded into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this works as intended (see my comment).
This seems to work out of the box with
So I assume this can be closed? |
Yep, it's been fixed. Thanks for reminding! |
Fixes #1271.