e2e test - mock a Express.Multer.File

Viewed 25

I am trying to test a function that take a Express.Multer.File in param. I am not sure about how to mock it. For now, what I've done:

  it('should return a pdf and status code 201 if a markdown is provided', async () => {
    // TODO: mock file
    return request(app.getHttpServer())
      .post('/v1/markdown-to-pdf')
      .send(file)
      .expect(201);
  });
0 Answers
Related