I have a mock object that I am using to mock react-native
:
const MyMock = {
MockA: {
methodA: jest.genMockFn()
},
MockB: {
I hadn't read the error message fully. On the last line(slightly obscured) there is this:
Note: This is a precaution to guard against uninitialized mock variables. If it is ensured that the mock is required lazily, variable names prefixed with
mock
are permitted.
So when I changed MyMock
to for instance mockMyMock
, it worked.