An issue arose with the test case below:
it('should access MAX_COUNT', async () => {
const maxCount = await myContract.functions.MAX_COUNT();
expect(maxCount).to.equal(64);
});
The test failed with this error message:
AssertionError: expected [ BigNumber { value: "64" } ] to equal 64
This code snippet represents a simplified version of the smart contract under testing:
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;
contract MyContract
{
uint256 public constant MAX_COUNT = 64;
}
Questioning why the return value is displayed as
[ BigNumber { value: "64" } ]
instead of BigNumber { value: "64" }
.
To provide context, this inquiry initially originated from an attempt to resolve this question: How to correctly import
@nomicfoundation/hardhat-chai-matchers
into hardhat project? ...
However, it proved to be entirely unrelated.