1
我正在使用superagent-bluebird-promise,以下給出了404錯誤「不能GET/v1/result」。當我通過郵遞員打電話時,確認它有效。我究竟做錯了什麼?superagent-bluebird-promise不能GET
it('should return a result', function(done){
stub.login(userId);
request.get('http://localhost:8080/v1/result/')
.then(function(res) {
console.log(res);
expect(res.body).to.have.lengthOf(1);
}, function(error) {
console.log(error);
expect(error).to.not.exist;
})
.finally(function(){
stub.logout();
done();
});
});
登錄是異步的嗎?如果您已註銷,您是否收到該頁面? – Bergi
如果我註釋掉stub.login(),我會得到相同的結果。 (Live,如果我沒有登錄,我會得到401而不是404)。 – Kristy