-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[jest-resolve] Use is-builtin-module
instead of resolve.isCore
.
#2997
[jest-resolve] Use is-builtin-module
instead of resolve.isCore
.
#2997
Conversation
expect(isCore).toEqual(false); | ||
}); | ||
|
||
it('returns true if `hasCoreModules` is false and `moduleName` is a core module.', () => { |
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.
is true
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.
Thank you.
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.
Wait, this doesn't make sense.
- If
hasCoreModules
is true, it should return true if you pass in a core module. If it is false, it should return false when passing in a core module. - If
hasCoreModule
is true, it should return false if you pass in a non-core module. If it is false, it should always return false.
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.
Isn't that what it is doing? Should I have a test for hasCoreModule: false
and isCore('non-core-module')
?
You are right. Do you mind removing "browser: false"? It doesn't really do anything and confuses me :) |
Generated by 🚫 dangerJS |
…estjs#2997) * Use `is-builtin-module` instead of `resolve.isCore`. * Fix typo. * Remove `browser: false`.
…estjs#2997) * Use `is-builtin-module` instead of `resolve.isCore`. * Fix typo. * Remove `browser: false`.
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. |
Summary
Uses
is-builtin-module
to determine if a module is a core module instead ofresolve.isCore
.resolve
is going away with #2925 andis-builtin-module
is already in the dependency tree (not specifically ofjest-resolve
).Test plan
Write tests for
Resolver.isCore
.