问题描述
我正在使用chai-as-promise来测试固体合同。这是断言失败的行。
return expect(instance.getItemPrecedingIds(dellLaptop.productId)).to.eventually.be.an('array').eql([new BN(intelI5cpu.productId),new BN(samsungSSD.productId),new BN(amdGraphicsCard.productId)]);
getItemsPrecedingIds函数返回一个uint []数组。 uint总是很大(尽管我不知道为什么会这样)。我尝试了许多变体,但控制台始终显示以下消息:
AssertionError: expected [ <BN: 2>,<BN: 3>,<BN: 5> ] to deeply equal [ <BN: 2>,<BN: 5> ] + expected - actual
它甚至不会告诉我预期与实际之间的任何差异。
我尝试过的其他一些变体也失败了:
return expect(instance.getItemPrecedingIds(dellLaptop.productId)).to.eventually.be.a.bignumber.and.have.same.members([new BN(intelI5cpu.productId),new BN(amdGraphicsCard.productId)]);
return expect(instance.getItemPrecedingIds(dellLaptop.productId)).to.eventually.have.same.members.a.bignumber.eql([new BN(intelI5cpu.productId),new BN (amdGraphicsCard.productId)]);
任何帮助将不胜感激。预先感谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)