Open AbdulmalickDimnang opened 3 years ago
Did you find a solution?
did you find solution
try to add this in you jest file:
transformIgnorePatterns: [ 'node_modules/(?!(jest-)?@?react-native|@react-native-community|@react-navigation|@react-native-vector-icons|react-navigation-shared-element)', ],
@igormoraesdev I couldn't find it working :( can you please share complete code snippet?
also getting the issue, no one found a solution?
Hello i just replaced them with this and it works
jest.mock('react-navigation-shared-element', () => {
return {
createSharedElementStackNavigator: jest.fn(),
};
});
just return an object instead of a function
See also: https://github.com/IjzerenHein/react-navigation-shared-element/issues/274 as this is related.
I'm getting
TypeError: (0 , _reactNavigationSharedElement.createSharedElementStackNavigator) is not a function
when testing with jestyarn test
ornpm jest
I have added these mocks to jest Setup file
But still failing to test with Jest
I'm using "react-native": "0.64.0", "jest": "^25.1.0", "react-native-shared-element": "^0.7.0", "react-navigation-shared-element": "3.0.0",