[Solved] TypeError: Cannot read properties of undefined (reading ‘equal’) [closed]


You didn’t close the parenthesis around the expect calls in the second test correctly. You’re accessing .to on the number returned by .balanceOf.

Replace with:

expect(await hardhatToken.balanceOf(addr1.address)).to.equal(10);
// ...
expect(await hardhatToken.balanceOf(addr2.address)).to.equal(5);

2

solved TypeError: Cannot read properties of undefined (reading ‘equal’) [closed]