react-native: Testing using jest broken since 0.14.0
The jestSupport/scriptPreprocess.js
file that is recommended for use in testing (see https://facebook.github.io/react-native/docs/testing.html#jest-tests) was removed in 0.14.0:
https://github.com/facebook/react-native/commit/54b1402c435832a2a98c9252c5f6dacaed631ffe
Using preprocessor.js
instead doesn’t work, because it makes assumptions about the folder structure, and therefore where babel-core/package.json
can be found.
Can scriptPreprocess be added back in, or is there now a different recommendation for running tests?
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 41 (25 by maintainers)
Commits related to this issue
- Fix jest preprocessor script Summary: Related to #3999 There is an issue with the `preprocessor` script when using node >=5 as it uses npm 3. ~~There are (at least) two solutions, (I'm submitting th... — committed to facebook/react-native by ahanriat 8 years ago
- Fix jest preprocessor script Summary: Related to #3999 There is an issue with the `preprocessor` script when using node >=5 as it uses npm 3. ~~There are (at least) two solutions, (I'm submitting th... — committed to wildlifela/react-native by ahanriat 8 years ago
- Fix jest preprocessor script Summary: Related to #3999 There is an issue with the `preprocessor` script when using node >=5 as it uses npm 3. ~~There are (at least) two solutions, (I'm submitting th... — committed to skillz/react-native by ahanriat 8 years ago
I’m currently rewriting the documentation around Jest. The latest version of Jest and
babel-jest
have this issue resolved, but the integration with react-native isn’t ideal yet. There’ll be more info soon 😃Thank you for your patience. We launched Jest 14.0 with experimental react-native support:
Please feel free to create new issues after trying out the new integration if any issues remain.