Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expect doesn't work with bn.js of web3 out of the box #590

Open
lebed2045 opened this issue Nov 5, 2021 · 0 comments
Open

expect doesn't work with bn.js of web3 out of the box #590

lebed2045 opened this issue Nov 5, 2021 · 0 comments

Comments

@lebed2045
Copy link

lebed2045 commented Nov 5, 2021

Consider this code:

import {web3} from "hardhat";

import chai, {expect} from 'chai'
import {solidity} from "ethereum-waffle";
chai.use(solidity);

const AMOUNT = web3.utils.toBN(1e18);
expect(await tokenInstance.balanceOf(owner)).to.equal(AMOUNT);

fails with

 AssertionError: expected <BN: 56bc75e2d63100000> to equal <BN: 56bc75e2d63100000>

but if you explicitly cast bn to string - everything works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant