Commit Graph

5 Commits

Author SHA1 Message Date
PIYUSH GUPTA dc29f29f18 Revert "Remove react-clone-referenced-element dependency (#23933)"
ListView is still part of 0.59. We cant cherry-pick this one. Solved conflict manually.

This reverts commit 27872cf97c.
2019-04-08 23:27:05 +02:00
Michał Pierzchała 17292c9db2 Make Jest transform @react-native-community packages by default (#24294)
Summary:
Currently, `react-native` Jest preset will not automatically transpile extracted Lean Core modules (all under `react-native-community` org), so maintainers will likely need to update their docs on how to do that (it's a common pain in RN testing story).

We can make it easier for users and maintainers by adding RNC modules to the `transformIgnorePatterns` whitelist we have in Jest preset. Some of them are not necessary to transpile, but I'd say it's a small sacrifice to make (having first test run possibly slower) for having less friction around migrating to extracted modules.

[General] [Added] - make Jest transform react-native-community/ packages by default
Pull Request resolved: https://github.com/facebook/react-native/pull/24294

Differential Revision: D14748962

Pulled By: cpojer

fbshipit-source-id: 36300ee021f03b8c13275a6e0cf28d988ee5beba
2019-04-08 23:21:52 +02:00
Michał Pierzchała dc25f209d7 chore: update Jest preset to align with Jest 24 (#24062)
Summary:
Jest 24 includes [`testMatch` and `moduleFileExtensions`](c5fd7aae93/packages/jest-config/src/Defaults.ts (L70)) that align with the ones that are currently there on master, because it added default handling for TypeScript as well. I think it's time for us to move to Jest 24. Is there a way we can tell users to upgrade Jest to certain version?

Fixes https://github.com/facebook/react-native/issues/24060

[General] [Changed] - update Jest preset to align with Jest 24
Pull Request resolved: https://github.com/facebook/react-native/pull/24062

Differential Revision: D14538988

Pulled By: cpojer

fbshipit-source-id: d8d152b8e8517b34144970f1cc1ed0b49f8b4e54
2019-04-08 23:21:49 +02:00
James Ide 27872cf97c Remove react-clone-referenced-element dependency (#23933)
Summary:
This package was a dependency for ListView, which is no longer part of RN. Removed the dependency from package.json and yarn.lock.

Also removed its pattern from the Jest preset -- ListView is not in this repo and also react-clone-referenced-element was written at a time when Node did not support the same modern JS features as RN. The latest Node 8+ supports the features that react-clone-referenced-element uses so we don't need to transform it.

[General] [Removed] - Removed unused react-clone-referenced-element dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/23933

Differential Revision: D14477240

Pulled By: cpojer

fbshipit-source-id: 4f6975133b54cc75088262cedd11da20225cada8
2019-04-08 23:21:38 +02:00
Simen Bekkhus 991e83f568 fix: use `require.resolve` in `jest-preset` (#22972)
Summary:
The current way the Jest preset work requires the different files to be in `<rootDir>/node_modules/react-native`. This is not necessarily true - especially in monorepoes.

If we instead do `require.resolve`, we do not need to do `rootDir` replacement in Jest.

Having a JS file as preset has been supported since Jest 23.0.0: https://github.com/facebook/jest/pull/6185

Changelog:
----------

[General] [Fixed] - use `require.resolve` in `jest-preset`
Pull Request resolved: https://github.com/facebook/react-native/pull/22972

Differential Revision: D13662758

Pulled By: hramos

fbshipit-source-id: ca79b5b89d9d05c6fe639b0d88619858e8d05da7
2019-01-14 16:35:38 -08:00