-
-
Save ddikodroid/3cc020103a0e7c5957d55934766a2aba to your computer and use it in GitHub Desktop.
mock @react-navigation/native for unit testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jest.mock('@react-navigation/native', () => { | |
return { | |
useNavigation: () => ({ | |
navigate: jest.fn(), | |
dispatch: jest.fn(), | |
}), | |
useRoute: () => ({ | |
params: { | |
id: '123', | |
}, | |
}), | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment