-
-
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
Flow type support? #607
Comments
I suggest using babel-jest to preprocess your files and strip flow-annotations before tests are being run on them. Follow the guide for React testing on the bottom here: http://facebook.github.io/jest/docs/tutorial-react.html#content (Note: we are in the process of upgrading babel-jest to babel6. For now I recommend using babel-jest 5 until we have ironed out the issues). |
Thanks, problem was exactly with usage of babel 6 ! Babel-jest 5 works like a charm. |
@cpojer, that tutorial didn't explain how to install the babel plugin |
I think we should add some notes for this somewhere. cc @hramos. |
FWIW Here is the transformer I put together to get jest running with
|
Ooof, I wasn't aware this was an issue people might need help with. If you still think this should be documented, feel free to open a new issue and assign it to me. |
The only reason I commented here (which I now realize was closed, my bad) is the last comment saying "yeah, we should document this!" |
Yeah! That is on me to document. Unfortunately it's not been on my mind as the issue is closed. |
@thomb |
Hi @thymikee, do you have a sample? I imagine that requires several configurations for prod, dev and testing. |
.babelrc {
"presets": [
"flow"
]
} That's all. |
Flow is supported, if you are getting this error, it's because you didn't properly set up your babel build pipeline. |
@cpojer Well I'm using the flow preset, and I think it's an error specific to jest, given it works fine when I just use |
@aksonov |
I am adding a jest feature to unity tests, @thomb, compilation broken. It does not work for me. am I missing anything? |
I have the same problem as @rayrutjes. Is there any solution to it? |
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. |
I'm trying to use flow syntax within unit tests, but i don't see any way to test it
The text was updated successfully, but these errors were encountered: