title: How to mock functions of a function?
body: <p>I'm using <code>simple-git</code> in my script like this:</p>
  <pre><code>import simpleGit from 'simple-git'
  const git = simpleGit()
  
  const foo = async (): Promise&lt;void&gt; =&gt; {
    const tags: string = await git.tag({
      '--list': null,
      '--format': '%(objectname:short)'
    })
  }
  </code></pre>
  <p>In my tests I need to mock out the git calls, which I'm doing this way:</p>
  <pre><code>jest.mock('simple-git', () =&gt; ({
    tag: () =&gt; jest.fn()
  }))
  </code></pre>
  <p>But this is failing. I guess, I have to take care of <code>const git = simpleGit()</code></p>