I use supertest to test my api, the delete endpoint works fine when testing with some restful client such as postman but failed in supertest.
it('should return 200', function (done) {
request(app)
.del('/v1/xxxx/' + id)
.expect('Content-Type', /json/)
.expect(200, done);
});
But it pass the test when I add
it('should return 200', function (done) {
request(app)
.del('/v1/xxxx/' + id)
.send({})
.expect('Content-Type', /json/)
.expect(200, done);
});
Can some one tell me why?