Please provide the following:
- SDK Version: 46
- Platforms(Android/iOS/web/all): jest
I updated jest-expo
to v46 and now my Constants
are having an issue where they are undefined
. I thought trying to mock it would work like so:
jest.mock('expo-constants', () => {
return {
...jest.requireActual('expo-constants'),
__esModule: true,
default: jest.fn(),
manifest: {
extra: {
api: 'ourURL',
},
},
};
});
I also tried moving this from the jest-setup
file into it’s own under the __mocks__
dir, but no difference.
However, Constants
is still undefined when running my jest test.
Is there a trick to mocking this package?