Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

supertest formdata

// Use .attach(field, file)

it('should pass', () => {
    return request(app)
      .post('/upload')
      .attach('avatar', path.resolve(__dirname, './downloads/5k.jpg'))
      .expect(200);
  });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #supertest #formdata
ADD COMMENT
Topic
Name
9+9 =