I'm testing the value of a BigNumber returned from a function call to a contract and its not working as expected.
I have this
const { BigNumber } = require('ethers');
...
const totalSupply = await token.totalSupply();
expect(totalSupply).to.equal(BigNumber.from("4"));
This test fails with this error:
AssertionError: expected BigNumber { value: "4" } to equal BigNumber { value: "4" }
+ expected - actual
But looking at the error message it appears the expected and actual are the same. Why does this test fail?