// Use .attach(field, file) it('should pass', () => { return request(app) .post('/upload') .attach('avatar', path.resolve(__dirname, './downloads/5k.jpg')) .expect(200); });