-
-
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
ReactNative Animated is not properly mocked #4359
Comments
This is not a Jest issue, this is an issue with react-native. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions. Thank you :) |
It looks like a jest bug to me. A bug related with timers. |
@sospedra , I am having the same issue, were you able to find a workaround? |
@AtticusFetch For reasons we needed the timer to be fixed hence we started using Hope it helps |
This works fine. However adding this breaks promise based this cases |
I think this is the same that @sospedra wanted to let us know but I will just mention that by only adding:
On the top of your test file, it will make it work, I haven't dug too much into how/why it works, but it does it. Cheers. Reference at:
|
Was having the similar issue with RN 59, use the below things to get rid of this error ,
|
This did it for me:
|
Thanks. It helped me with FlatList snapshot |
@duranmla , thanks for that trick. I was having issues in CodeSandbox even after explicitly setting test environment to |
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. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Animated is not mocked
Using
react-native
0.47jest
20react
16react-test-renderer
16Implement any
Animated
component. With thenew Animated.value
and so on. And make a snapshot test.It'll return:
Log error
What is the expected behavior?
Should mock properly
Animated
, like the otherreact-native
components so it doesn't break.The text was updated successfully, but these errors were encountered: