-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Add jest-resolve to resolve modules based on the Facebook module resolution algorithm.
#1007
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
Conversation
6c369de to
3c35bbb
Compare
|
@facebook-github-bot import |
|
Thanks for importing. If you are an FB employee go to Phabricator to review. |
|
cc @davidaurelio, as always for these kind of things :) |
…solution algorithm.
|
oh man, I’m sorry. I totally lost sight of this. |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This refactors Runtime.js and TestRunner.js and pulls out the resolution code into a new module
jest-resolvewhich now encodes Facebook's module resolution algorithm. It provides the second half of node-haste and together withjest-haste-mapcan be seen as a full replacement.There is very little new code in this diff. Most code is existing code that was lifted from another module and brought together. The next step after this diff will be to see if it makes sense to fork the
resolvemodule and speed up how it works.It doesn't come with its own tests (yet) because its functionality is completely covered by all the tests in Runtime.js. I have also cleaned up all of the Runtime tests and added a new
createRuntimehelper for testing, which should make it much easier from now on to change how an instance of Runtime is constructed for tests.