npm install --save-dev chai-bn
const chai = ;const BN = ;// Enable and inject BN dependencychai;
The following assertion methods are provided and will override the existing builtin assertions if the
bignumber property is set as part of the assertion chain:
A set of additional assertion properties is also provided:
Both actual values (the values being asserted) and expected values (the values the actual value is expected to match) can be either instances of
BigNumber instances for both actual and expected values.
Only BDD style (
should) assertions are supported.
const actual = '100000000000000000';const expected = '100000000000000001';actualshouldbeabignumberthat;tobeabignumberthatisat;'1000'shouldbeabignumberthatis;
Chai properties (e.g. the
that.is chain) have no effect other than increasing readability, and can be dropped if less verbosity is desired.