title: Mock only one function from module jest
body: <p>// utils.ts</p>
  
  <pre><code>export const foo = () =&gt; {...}
  export const bar = () =&gt; {...}
  </code></pre>
  
  <p>I only want to mock foo function, bar must stay the same</p>
  
  <pre><code>jest.mock('../utils', () =&gt; {
      return {foo: jest.fn()}
  })
  </code></pre>
  
  <p>Since I use Typescript, I cannot do like </p>
  
  <pre><code>import * as utils from '../utils'
  utils.foo = jest.fn(() =&gt; console.log(..)) // Cannot assign read only
  </code></pre>
  
  <p>I can mock foo like this but I think bar function will be mocked as well. Could you show me the way to mock only foo function</p>