title: How to check if mocked inner function has been called in jest?
body: <p>here is my file under test: </p>
  
  <p><strong>file.js</strong>: </p>
  
  <pre><code>function handleRequest(grpcRequestObj, callback){
  
      if(grpcRequestObj.type === REAL_CLIENT_REQUEST){
          log.trace("Запрос от реального клиента", refId);
          module.exports.realClientRequestWay(grpcRequestObj, callback);
          return;
      }
  }
  function realClientRequestWay(grpcRequestObj, callback){
      //some logic
  }
  
  module.exports = {
      handleRequest,
      realClientRequestWay
  }
  </code></pre>
  
  <p><strong>test file</strong>:</p>
  
  <pre><code>
      test("should call real clients way", ()=&gt;{
          jest.mock("../lib/grpc/state");
  
          const state = require("../lib/grpc/state");
          state.ready = true;
          const constants = require("../lib/grpc/constants");
          const handleRequestModule = require("../lib/grpc/handleRequest");
          const { handleRequest } = jest.requireActual("../lib/grpc/handleRequest");
  
          handleRequestModule.realClientRequestWay = jest.fn();
  
          const grpcRequest = {
              type: constants.REAL_CLIENT_REQUEST,
              refId: "123"
          };
          const mockCb = jest.fn();
          handleRequest(grpcRequest, mockCb);
          expect(handleRequestModule.realClientRequestWay).toHaveBeenCalledTimes(1);
      });
  </code></pre>
  
  <p>I am mocking realClientRequestWay fucntion to be a jest mock function just to check if it runs,
  but it is not calling, what am I doing wrong? </p>