title: Jest how to test if a mocked function is called
body: <p>In my jest test I mock a service that i have made like this:</p>
  
  <pre><code>jest.mock("../../services/testService");
  </code></pre>
  
  <p>this works fine. Now I want to test if a mocked function was called how can is do this?</p>
  
  <p>It tried to put the mock in a variable like this:</p>
  
  <pre><code>const fn = jest.mock("../../services/testService");
  </code></pre>
  
  <p>But when i do this i get errors because the test now refer to the real testservice and not the mocked one.</p>
  
  <p>Can someone tell me how to test if a mocked function was called?</p>