Tests not working
Describe the bug Tests not running
Expected behavior Test runs and get passed.
To Reproduce Steps to reproduce the behavior:
- Setup the project.
- Install dependencies
- Run pre-scripts
- npm test
On adding the following lines to package.json devdependencies, the tests start running but they still fail:-
"babel-jest": "^23.2.0", "babel-plugin-jest-hoist": "^23.2.0"
Error: RNFirebase core module was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects Podfile
and have run pod install
. Then I looked up online to force it to only test for android but then the same error came up for andrdoid.
I added this code on top of my test file to mock all the test on Android :
jest.mock('Platform', () => { const Platform = require.requireActual('Platform'); Platform.OS = 'android'; return Platform; })
But it resulted in a similar error for android
error: RNFirebase core module was not found natively on Android, ensure you have correctly added the RNFirebase and Firebase gradle dependencies to your android/app/build.gradle
file.