Skip to content
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

Merged
merged 3 commits into from
Feb 24, 2017
Merged

[jest-resolve] Use is-builtin-module instead of resolve.isCore. #2997

merged 3 commits into from
Feb 24, 2017

Conversation

wtgtybhertgeghgtwtg
Copy link
Contributor

Summary
Uses is-builtin-module to determine if a module is a core module instead of resolve.isCore. resolve is going away with #2925 and is-builtin-module is already in the dependency tree (not specifically of jest-resolve).

Test plan
Write tests for Resolver.isCore.

expect(isCore).toEqual(false);
});

it('returns true if `hasCoreModules` is false and `moduleName` is a core module.', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

Copy link
Member

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.

Copy link
Contributor Author

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')?

@cpojer
Copy link
Member

cpojer commented Feb 24, 2017

You are right. Do you mind removing "browser: false"? It doesn't really do anything and confuses me :)

@cpojer cpojer merged commit 07c7a20 into jestjs:master Feb 24, 2017
@jest-bot
Copy link
Contributor

Warnings
⚠️ Please ensure that @flow is enabled on: packages/jest-resolve/src/__test__/resolve-test.js

Generated by 🚫 dangerJS

skovhus pushed a commit to skovhus/jest that referenced this pull request Apr 29, 2017
…estjs#2997)

* Use `is-builtin-module` instead of `resolve.isCore`.

* Fix typo.

* Remove `browser: false`.
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
…estjs#2997)

* Use `is-builtin-module` instead of `resolve.isCore`.

* Fix typo.

* Remove `browser: false`.
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants