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

Fix typo on reanimated 2 mock.ts #3968

Merged
merged 1 commit into from
Jan 18, 2023
Merged

Fix typo on reanimated 2 mock.ts #3968

merged 1 commit into from
Jan 18, 2023

Conversation

GSTJ
Copy link
Contributor

@GSTJ GSTJ commented Jan 18, 2023

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:

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.

Captura de Tela 2023-01-18 às 15 13 44

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

Copy link
Member

@tomekzaw tomekzaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GSTJ Thanks for the PR! 🥳

@tomekzaw tomekzaw merged commit 9811880 into software-mansion:main Jan 18, 2023
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
## 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
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.

2 participants