-
-
Notifications
You must be signed in to change notification settings - Fork 502
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
what is a proper jest mock for react-native-screens? #247
Comments
For me, working with this:
|
fixed like this: const View = require('react-native').View;
export const enableScreens = jest.fn();
export const ScreenContainer = View;
export const Screen = View;
export const NativeScreen = View;
export const NativeScreenContainer = View;
export const ScreenStack = View;
export const ScreenStackHeaderConfig = View;
export const ScreenStackHeaderSubview = View;
export const ScreenStackHeaderRightView = View;
export const ScreenStackHeaderLeftView = View;
export const ScreenStackHeaderTitleView = View;
export const ScreenStackHeaderCenterView = View; |
I used this approach. Within my jest setup file: jest.mock('react-native-screens', () => ({
...jest.requireActual('react-native-screens'),
enableScreens: jest.fn(),
})); |
If you are using
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: