次のテストの動作がおかしい:
it('Should return the exchange rates for btc_ltc', function(done) {
    var pair = 'btc_ltc';
    shapeshift.getRate(pair)
        .then(function(data){
            expect(data.pair).to.equal(pair);
            expect(data.rate).to.have.length(400);
            done();
        })
        .catch(function(err){
            //this should really be `.catch` for a failed request, but
            //instead it looks like chai is picking this up when a test fails
            done(err);
        })
});
拒否された約束を適切に処理(およびテスト)するにはどうすればよいですか?
失敗したテストを適切に処理するにはどうすればよいexpect(data.rate).to.have.length(400);ですか(例:?
これが私がテストしている実装です:
var requestp = require('request-promise');
var shapeshift = module.exports = {};
var url = 'http://shapeshift.io';
shapeshift.getRate = function(pair){
    return requestp({
        url: url + '/rate/' + pair,
        json: true
    });
};
          
Ensure the done() callback is being called in this testmocha 2.2.5でこれを実行しようとすると、エラーが発生します。