Skip to content
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

Add mocks for addWhitelistedUIProps & addWhitelistedNativeProps #1574

Merged
merged 1 commit into from
Dec 28, 2020

Conversation

jakub-gonet
Copy link
Member

Description

Fixes #1555.

@jakub-gonet jakub-gonet merged commit 0c2e5ae into master Dec 28, 2020
@jakub-gonet jakub-gonet deleted the @kuba/missing-mocks branch December 28, 2020 09:20
@ididlive
Copy link

Hello, I'm @felquis

I want to point out for future visitors that the error bellow

  ● Test suite failed to run

    TypeError: _reactNativeReanimated.default.addWhitelistedUIProps is not a function

      at Object.<anonymous> (node_modules/@gorhom/bottom-sheet/lib/commonjs/components/bottomSheet/BottomSheet.tsx:75:10)
      at Object.<anonymous> (node_modules/@gorhom/bottom-sheet/lib/commonjs/components/bottomSheet/index.ts:1:1)

Happens on a combination of @gorhom/bottom-sheet version 2.3.0
and react-native-reanimated 1.13.3

If you encounter this error, consider upgrading your modules to the latest version.

@tj-mc
Copy link

tj-mc commented Jun 14, 2021

Thanks for leaving the comment @ididlive , I'm having the exact same issue. Do you know of another solution, as we are unablet to upgrade to reanimated 2 at the moment.

@dtokarczyk
Copy link

dtokarczyk commented Aug 10, 2021

Solution for someone who has to have 1.x. version. I added

Reanimated.default.addWhitelistedUIProps = () => {}

to jest.mock('react-native-reanimated', () => {...}) in setupJest.js and works.

But then I got the next error. I wrote about that in gorhom/react-native-bottom-sheet#568

@RatebSeirawan
Copy link

RatebSeirawan commented Oct 14, 2021

Is this published?
I can't find the changes in 1.13.3

or is it reanimated2 only!

@jakub-gonet
Copy link
Member Author

It wasn't backported to v1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: _reactNativeReanimated.default.addWhitelistedUIProps is not a function when mocking in Jest
6 participants