title: How to test a instance of component use `ref` from native module
body: <p>I have a problem with <code>mock</code> function</p>
  
  <pre><code>class MyScreen extends Component {
    constructor(props) {
      this.video = React.createRef();
    }
  render() {
  return (
    &lt;VideoPlayer
      ref={this.video}
      onVideoSuccess={() =&gt; {
        this.video.current.startVideo();
      }}
    /&gt;);
   }
  }
  </code></pre>
  
  <p>how can I test pass with <code>this.video.current.startVideo()</code>, i don't know how to mock this function <code>startVideo()</code>of component <code>VideoPlayer</code></p>
  
  <pre><code>export default class VideoPlayer extends Component {
    startVideo() { ... }
    play() {...}
    pause() {...}
    stop() {...}
    render() {
      return &lt;VideoPlayerView {...this.props} /&gt;
    }
  }
  </code></pre>