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

Support custom platforms on jest-haste-map #3162

Merged
merged 2 commits into from
Mar 17, 2017
Merged

Conversation

andrewimm
Copy link
Contributor

Summary

The options object allows specification of custom platforms, but jest-haste-map doesn't use this when checking for duplicates, which leads to a lot of unnecessary warning messages on custom platforms.

Test plan

Ran these changes on a project with the following package.json configuration:

// ...
  "jest": {
    "haste": {
      "platforms": ["vr"],
// ...

And two files: MyModule.js and MyModule.vr.js, both of which contain @providesModule MyModule

Without these changes, jest-haste-map produces a warning. With these changes, no warnings occur.

@andrewimm
Copy link
Contributor Author

Note: I sought to maintain all pre-existing behaviors with this change. Calling it with an arbitrary platforms array or no array at all should still return the same result for previously-supported platforms.

@cpojer cpojer merged commit eed8203 into jestjs:master Mar 17, 2017
@cpojer
Copy link
Member

cpojer commented Mar 17, 2017

Thanks @andrewimm. As a follow-up, I feel like it may make sense to turn the platforms object into a Set in the constructor so that lookups will be faster. Would you be interested in sending a PR for this?

@andrewimm
Copy link
Contributor Author

Sure, happy to follow up with a move to Set

cpojer pushed a commit that referenced this pull request Mar 17, 2017
* [jest-jasmine2] Split `jasmine-light` over multiple files.

* Don't wrap things that don't need to be wrapped.

* Don't wrap things that don't need to be wrapped (again).

* Lint.

* [jest-jasmine2] Trim `jasmine` singleton.

* Adding NHL to companies that use Jest (#3163)

* Support custom platforms on jest-haste-map (#3162)

* Support custom platforms on jest-haste-map

* Run prettier

* Rebase.
skovhus pushed a commit to skovhus/jest that referenced this pull request Apr 29, 2017
* Support custom platforms on jest-haste-map

* Run prettier
skovhus pushed a commit to skovhus/jest that referenced this pull request Apr 29, 2017
* [jest-jasmine2] Split `jasmine-light` over multiple files.

* Don't wrap things that don't need to be wrapped.

* Don't wrap things that don't need to be wrapped (again).

* Lint.

* [jest-jasmine2] Trim `jasmine` singleton.

* Adding NHL to companies that use Jest (jestjs#3163)

* Support custom platforms on jest-haste-map (jestjs#3162)

* Support custom platforms on jest-haste-map

* Run prettier

* Rebase.
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
* Support custom platforms on jest-haste-map

* Run prettier
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
* [jest-jasmine2] Split `jasmine-light` over multiple files.

* Don't wrap things that don't need to be wrapped.

* Don't wrap things that don't need to be wrapped (again).

* Lint.

* [jest-jasmine2] Trim `jasmine` singleton.

* Adding NHL to companies that use Jest (jestjs#3163)

* Support custom platforms on jest-haste-map (jestjs#3162)

* Support custom platforms on jest-haste-map

* Run prettier

* Rebase.
@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.

3 participants