title: node ts-jest spyOn method does not match overload
body: <p>I'm trying to use Jest in conjunction with <a href="https://www.npmjs.com/package/ts-jest" rel="nofollow noreferrer">ts-jest</a> to write unit tests for a nodeJS server. I have something set up very similar to below:</p>
  <p>impl.ts</p>
  <pre><code>export const dependency = () =&gt; {}
  </code></pre>
  <p>index.ts</p>
  <pre><code>import { dependency } from './impl.ts';
  export { dependency };
  </code></pre>
  <p>consumer.ts</p>
  <pre><code>import { dependency } from '../impl' &lt;- importing from index.ts
  export const consumer = () =&gt; {
    try {
     dependecy();
     return true;
    } catch (error) {
      return false;
    }
  }
  </code></pre>
  <p>consumer.test.ts</p>
  <pre><code>import * as dependencies from '../impl'
  import { consumer } from './consumer'
  const mockDependency = jest.spyOn(dependencies, 'depenedncy');
  describe('function consumer', function () {
    beforeEach(function () {
       mockDependency.mockReturnValueOnce(false);
    });
  
    test('should return true', () =&gt; {});
  })
  </code></pre>
  <p>This is just toy code, but the actual export / import / test files follow a similar structure. I'm getting typescript errors along these lines:</p>
  <p><code>TS2769: No overload matches this call.</code>
  Specifically, that the method being spied on is not part of the overload of the import for dependencies, so I can't stub it out. I am doing literally the same thing in a different test file and it has no issues. Anyone know how to resolve the typing issue?</p>