I try to use supertest-as-promised with chai's expect. The test should go like this: post some JSON the foos
endpoint, then call bars
endpoint, where the response's body has a length of 2.
it('should fail', function(){
var agent = request(app)
agent
.post('/foos')
.send({
// some JSON
})
.then(function(){
agent.get('/bars').then(function(res){
console.log(res);
expect(res).to.have.deep.property('body.data').and.have.property('length').and.equal(3)
})
})
})
console.log does not run, and the test passes no matter what i write to equal.