title: How to simulate android back button in react-native test
body: <p>In <code>componentDidMount</code> I'm adding a listener to handle Android back navigation and would like to add tests around it's behaviour. How do I firstly test something in <code>componentDidMount</code> and secondly how would I simulate clicking the back button.</p>
  
  <pre><code>class Component extends React.Component {
    componentDidMount () {
      BackHandler.addEventListener('hardwareBackPress', () =&gt; {...})
    }
  }
  </code></pre>