Using Jest testing in a React Native Expo project
I’m trying to mock some node modules in my project, but many of them have different import export methods.
1 Some are destructured:
import { myFunc } from 'my-module'
2 Some are default:
import myModule from 'my-module'
3 Some are the everything import:
import * as myModule from 'my-module'
4 In other cases, I need to mock a nested function like:
myModule.dosomething()
How do I mock each of these? I cannot for the life of me find a guide that explains it.