The assertion for the following test fails:
it('should access MAX_COUNT', async () => {
const maxCount = await myContract.functions.MAX_COUNT();
expect(maxCount).to.equal(64);
});
With the following error:
AssertionError: expected [ BigNumber { value: "64" } ] to equal 64
This is the solidity code for (the concise version of) the smart contract being tested:
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;
contract MyContract
{
uint256 public constant MAX_COUNT = 64;
}
Why is the return value [ BigNumber { value: "64" } ]
instead of just BigNumber { value: "64" }
?
For context, this question was originally created while trying to figure out this one:
How to correctly import @nomicfoundation/hardhat-chai-matchers
into hardhat project? ...
However turns out to be completely unrelated.