Skip to content

Commit

Permalink
Fix typo on reanimated 2 mock.ts (software-mansion#3968)
Browse files Browse the repository at this point in the history
## Summary

We have a typo on
`react-native-reanimated/lib/commonjs/reanimated2/mock`, where
`FadeInDown` is typed wrong, and mocked as `FadFadeInDown`. This PR
fixes it.

## Test plan

I'm mocking Reanimated on jest in this way, on the new version:
```ts
jest.mock('react-native-reanimated', () => {
  return {
    ...jest.requireActual('react-native-reanimated/mock'),
    ...jest.requireActual(
      'react-native-reanimated/lib/commonjs/reanimated2/mock',
    ),
  };
});
```

But, as this typo makes the Reanimated2 mocks not contain the FadeInDown
method, Jest throws this error on files that use this Fade.

<img width="670" alt="Captura de Tela 2023-01-18 às 15 13 44"
src="https://user-images.githubusercontent.com/50031755/213261421-b533f182-cb27-48aa-9360-77881394d865.png">

I'm currently fixing it with patch-package, while that isn't officially
merged and released. The issue is still present after updating to
3.0.0-rc.10
  • Loading branch information
GSTJ authored and fluiddot committed Jun 5, 2023
1 parent 9c094f2 commit 8bd1b06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/reanimated2/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const ReanimatedV2 = {
'FadeInRight',
'FadeInLeft',
'FadeInUp',
'FadFadeInDown',
'FadeInDown',
'FadeOut',
'FadeOutRight',
'FadeOutLeft',
Expand Down

0 comments on commit 8bd1b06

Please sign in to comment.