Closed rajAmukhliS closed 2 years ago
I have found 2 ways to get rid of this issue
react-native-qrcode-scanner
inside the test file , this is solution for single file as shown below
write mock of react-native-qrcode-scanner
on top of test file after importsjest.mock('react-native-qrcode-scanner', () => jest.fn());
react-native-qrcode-scanner
inside the jest.setup.js file , this is solution for all tests files as shown below
write mock of react-native-qrcode-scanner
inside jest.setup.js file in root dir as shown below
jest.mock( 'react-native-qrcode-scanner/node_modules/react-native-permissions', () => require('react-native-permissions/mock'), );
Do you think one of them is better than the other? If so, please consider documenting and submitting a pull request to improve the readme, thanks 🙏
Discussed in https://github.com/moaazsidat/react-native-qrcode-scanner/discussions/371