当promise是bignumber数组时,Chai-as-Promise失败断言

问题描述

我正在使用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 (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...