According to Hardhat Tutorial, while writing tests, some cases are written like
expect(await hardhatToken.totalSupply()).to.equal(ownerBalance);
while others are written
await expect(hardhatToken.transfer(addr1.address, 50)).to.changeTokenBalances(hardhatToken, [owner, addr1], [-50, 50]);
What is the rule behind positioning await
statement in tests? When should it go before and when inside of expect()
function?