使用mocha和chai,我试图通过我的第二个测试来获得被拒绝的promise,但是我得到了这个错误Error: the string "error" was thrown, throw an Errorthe promise with an error', async function(){ expect(await fn(arg)).to.be.rejectedWith
我正在尝试测试被拒绝的承诺的细节,使用、和“应该”方言。承诺是由实现的。我想断言这一状态是401it('it should be rejected when given bad credentials', function () {
.that.has.property('status')
.that.equals(401