v3.0.0
While testing application with Jest throws an error:
TypeError: Cannot read property 'OS' of undefined
at createIconSet (node_modules/react-native-vector-icons/lib/create-icon-set.js:26:25)
at Object.<anonymous> (node_modules/react-native-vector-icons/FontAwesome.js:9:28)
...
import FontAwesome from 'react-native-vector-icons/FontAwesome';
I got the similar issue did any one find solution for the above ?
TypeError: Cannot read property 'osVersion' of undefined
at Object.get Version [as Version] (node_modules/react-native/Libraries/Utilities/Platform.ios.js:18:45)
at Object.<anonymous> (src/common/Touchable.js:5:53)
at Object.<anonymous> (src/common/CustomButton1.js:5:16)
at Object.<anonymous> (src/pages/LoginScreen.js:4:19)
@iegik Try it
jest.mock('react-native', () => ({
NativeModules: {
RNPasscodeStatus: {
supported: jest.fn(),
status: jest.fn(),
get: jest.fn(),
}
},
StyleSheet: {
create: () => ({})
},
Platform: {
OS: jest.fn(() => 'android'),
version: jest.fn(() => 25),
},
}));
@linhnh123 doesn't work for me.
does not works for me also :tophat:
TypeError: Super expression must either be null or a function
Think, that @linhnh123 solution should work
Most helpful comment
@iegik Try it