title: typescript interface extends mock
body: <p>I have a typescript interface <code>cRequest</code> that's being passed as a type in a class method.
  This interface also extends <code>express</code> Request type. What's the correct way to mock this in <code>jest</code> or <code>typemoq</code>? </p>
  
  <pre><code>import { Request } from 'express';
  import { User } from '.';
  export interface cRequest extends Request {
      context: {
          ID?: string;
          user?: string;
          nonUser?: string;
      };
      user?: User;
  }
  export default cRequest;
  </code></pre>
  
  <p>This is being used in a class method as follows</p>
  
  <pre><code>import { Response } from 'express';
  public getData = async (req: cRequest, res: Response) =&gt; {}
  </code></pre>
  
  <p>And if i try to test it as follows it fails</p>
  
  <pre><code>const expRespMock: TypeMoq.IMock&lt;Response&gt; = TypeMoq.Mock.ofType&lt;Response&gt;();
  const cReqMock: TypeMoq.IMock&lt;cRequest&gt; = TypeMoq.Mock.ofType&lt;cRequest&gt;();
  await classObj.getData(cReqMock, expRespMock);
  </code></pre>
  
  <p>with the following message</p>
  
  <pre><code>  Argument of type 'IMock&lt;cRequest&gt;' is not assignable to parameter of type 'cRequest'.
    Property 'context' is missing in type 'IMock&lt;cRequest&gt;'.
  </code></pre>
  
  <p>What's the correct way to inject this interface mock into the method in tests?</p>