setup-test.js
import MockAsyncStorage from 'mock-async-storage';
import { createDrawerNavigator } from '@react-navigation/drawer';
const mockImpl = new MockAsyncStorage();
jest.mock('@react-navigation/native')
jest.mock('react-navigation', () =>createTestProps)
jest.mock('@react-native-async-storage/async-storage', () => mockImpl);
jest.mock('@react-navigation/drawer', () => {
jest.mock(
'@react-navigation/drawer',
async () =>
await {
createDrawerNavigator: jest.fn().mockReturnValue({
Navigator: ({children}) => <>{children}</>,
Screen: ({children}) => <>{children}</>,
}),
},
);
});