title: How do I mock this method chain in Jest?
body: <pre><code>zoomOut(callback) {
          // Zooms out the current screen
          this.view.current.zoomOut(300).done(() =&gt; {
              (hasCallback(callback)) &amp;&amp; callback();
          });
      }
  </code></pre>
  
  <p>I'm trying to test the function above but I keep getting the following error:</p>
  
  <blockquote>
    <p>TypeError: this.view.current.zoomOut(...).done is not a function</p>
  </blockquote>
  
  <p>How can I mock this method chain in Jest?</p>