title: Getting ''Invariant Violation: Native module cannot be null.'' when I run the test
body: <p>I have a Login component as below and I am writing some test cases for this component. When I tried to run the test I got the following error:</p>
  
  <p><strong>Test</strong></p>
  
  <pre><code>import renderer from 'react-test-renderer'
  
  import Login from '../Login'
  let props, wrapper
  
  beforeEach(() =&gt; {
    props = {
      loginAttempt: jest.fn(),
      recoverAttempt: jest.fn(),
      reset: jest.fn()
    }
    wrapper = shallow(&lt;Login {...props} /&gt;)
  })
  
  describe('tests for &lt;Login /&gt;', () =&gt; {
    test('should have a formProvider with handlesubmit atribute', () =&gt; {
      const value = wrapper.find('FormProvider')
      expect(value.length).toBe(1)
    })
  })
  
  //Snapshot test
  test('Snapshot test for the Contact form', () =&gt; {
    const tree = renderer.create(&lt;Login {...props} /&gt;).toJSON()
    expect(tree).toMatchSnapshot()
  })
  </code></pre>
  
  <p><strong>Component</strong></p>
  
  <pre><code>import React, { Component } from 'react'
  import KeyboardAvoidingWrapper from 'components/Wrappers/KeyboardAvoidingWrapper'
  
  export default class AuthScreen extends Component {
    state = {
  
    }
  
    toggleRecovery = e =&gt; {
  
      )
    }
  
    loginAttempt = data =&gt; {
  
    }
  
    recoverAttempt = data =&gt; {
  
    }
  
    componentWillUnmount() {
  
    }
  
    render() {
      let { loginAttempt, toggleRecovery, recoverAttempt, state, props } = this
      let { recovery } = state
      let { error, fetching } = props
      return (
        &lt;KeyboardAvoidingWrapper enabled={false} behavior="padding" fluid&gt;
  
      UI GOES HERE..
  
        &lt;/KeyboardAvoidingWrapper&gt;
      )
    }
  }
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>  ● Test suite failed to run
  
      Invariant Violation: Native module cannot be null.
  
        at invariant (node_modules/react-native/node_modules/fbjs/lib/invariant.js:40:15)
        at new NativeEventEmitter (node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js:36:36)
        at Object.&lt;anonymous&gt; (node_modules/react-native-safari-view/SafariViewManager.ios.js:12:20)
        at Object.&lt;anonymous&gt; (node_modules/react-native-safari-view/index.js:1:238)
  </code></pre>
  
  <p>Why I am getting this error? Is it because the component does not get imported correctly? I could not figure out the why this happening. How can I solve this issue?</p>