How to expect one function to call another function?
<p>I am trying to mock a function call, and expect it to have called another function within it once.</p>
<p>myFunctions.test.js</p>
<pre><code>import { resetModal } from '../myFunctions.js';

describe('resetModal', () =&gt; {
  it('calls the clearSomethingInModal function', () =&gt; {
    const clearSomethingInModal = jest.fn();
    resetModal();
    expect(clearSomethingInModal.mock.calls.length).toBe(1);
  })
})
</code></pre>
<p>myFunctions.js</p>
<pre><code>export resetModal() {
  clearSomethingInModal()
}
</code></pre>
<p>However, Jest output says that it has not been called.  How can I best do this?</p>