-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Update Homepage #2365
Comments
@hramos where can i currently find the 'new' guides for react-native and babel setup? i've spent rather too long getting jest to work for a react-native build as the docs (as linked from the homepage) do not seem to reflect the current situation for an updated (0.39) React Native project. |
@tijs checkout the |
@thymikee thanks! the react-native setup outlined there seems the same as the current docs though? https://github.com/facebook/jest/blob/new-docs/docs/TutorialReactNative.md
I'm using the preset there as outlined in the docs but i can only get my tests to run when i add a custom .babelrc which adds some presets. which in turn breaks your build so i now have to resort to different presets for different babel presets..
Quite likely this is not the recommended setup. This fixes my iOS builds but i still have trouble with my android builds with this setup. Either way it seems like the docs do not cover the full setup? |
Have you tried setting transformIgnorePatterns?
|
not sure what i should be ignoring? on android when i setup jest as above the first error i get as the app bundle loads is |
@thymikee just to be sure; this example is also outdated right? the jest-react-native preset used there should now be just react-native and it's no longer needed to install the jest-react-native package as far as i can tell? https://github.com/facebook/jest/blob/master/examples/react-native/package.json |
Yes, there's a note on the beginning about deprecating To ignoring: by default whole
|
Yeah would cause less confusion especially as the tutorials call it the NEW jest which it turns out is already the old jest again :) for ignoring: isn't ignoring react-native (so it does get transformed) exactly what the preset already does? If i do not add my own ignore rules the react-native code transforms fine (as the preset takes care of that). But it's not enough to test my react-native project as i get the following error then:
This then is solved by adding the fbjs preset too (as in the package.json found in the react-native project). My tests now run and my bundle loads correctly for iOS. For android i get the error about object-assign not being found though. Even if that is unrelated it seems the default react-native config for jest should mention the fbjs preset too as that seems to be needed for any RN project not just mine? |
Sadly I don't have that knowledge about If you have any ideas how to improve this tutorial, feel free to send a PR against |
@thymikee ok will do. As soon as i figure out a repeatable setup i'll make a PR. |
@thymikee @hramos when creating my own simple mock as outlined in a comment to another issues here: #2208 (comment) the default jest setup for react-native with just the react-native preset configured does work correctly. I can now make builds again and run my tests. So i could add some troubleshooting tips to the current documentation for react-native and update the example. But eventually it's up to the react-native maintainers to make sure their code works correctly with jest out of the box i guess which seems to something they are aware off. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Let's tighten up the landing page at facebook.github.io/jest a bit.
Move "React Testing", "React Native Testing", and "API Reference" out of the red hero banner at the top. This leaves us with a single "Get Started" call-to-action.
The "Get Started" CTA links to a section further down in the homepage. Let's add the "React Testing", "React Native Testing", and "API Reference" CTAs here.
Update "Getting Started" introduction. Reader should be be presented the option to "Get Started with React Native Testing", or "Get Started with React Testing", etc (see previous checkbox). Or, user can proceed through "Getting Started" section using the embedded repl.it.
Update the three featured items at the top. New ones are: "Easy and Familiar", "Performance", "Snapshot Testing". Update the accompanying text as needed.
Replace snapshot testing section with a link to the new Snapshot Testing guide and some introductory text.
Replace babel section with a link to the new Babel configuration guide and some introductory text.
The text was updated successfully, but these errors were encountered: