title: Express/Typescript testing with Jest/Supertest
body: <p>I'm currently trying to test an express API,I'm using Jest and Supertest however I can't seem to get it to work.</p>
  <p>My code is :</p>
  <pre><code>router.get('/', async (req: Request, res: Response) =&gt; {
    const products: ProductType[] = await ProductModel.find({});
  
    res.send(products);
  });
  </code></pre>
  <p>My test is :</p>
  <pre><code>describe('GET /', () =&gt; {
    it('calls ProductModel.find and returns products', async () =&gt; {
      const mockproducts = 'this is a product';
  
      ProductModel.find = jest.fn().mockResolvedValueOnce(mockproducts);
  
      const response = await request(products).get('/');
  
      expect(response).toBe(mockproducts);
    });
  });
  </code></pre>
  <p>So basically, the mocked resolve value is all working fine but when I run the test, the res.send is not working.</p>
  <pre><code>TypeError: res.send is not a function
  </code></pre>
  <p>Could anyone advise what the problem is here?</p>
  <p>Thanks!</p>