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
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
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
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