【发布时间】:2016-06-04 19:38:38
【问题描述】:
以下测试不适用于 mocha-chai,它能够获取输入请求但抛出错误消息。
it('/hb : ', function (done) {
return chai.request(app)
.post('/hb')
.send({"a":1 })
.then(function (res) {
expect(err).to.be.null;
expect(res).to.have.status(200);
// { ah: { rt: [Object] }, ad: { mojo: 1 } } }
//console.log("CAlling DOne ........... +");
done();
}, function (err) {
//console.log(err);
throw err;
});
});
输出:
网络请求:/hb : : 错误:超过 2000 毫秒的超时。确保在此测试中调用了 done() 回调。
【问题讨论】: