I'm currently testing events that include numeric values:
const level = new BN(1);
truffleAssert.eventEmitted(tx, 'EventName', {level});
As you can see, the level
variable is a BN
, and holds the correct value, I've already checked that. However two BN
objects seem not to be equal when comparing through eventEmitted
.
I know I can do it in the following way:
const level = new BN(1);
truffleAssert.eventEmitted(tx, 'EventName', e => e.level.toString() === level.toString());
However this second way is less intuitive, longer to write, harder to maintain and definitely much dirtier.
Do you guys know if there's a workaround to make this work using objects rather than filter functions?