It's been mentioned that we have the following pattern in multiple parts of our test suite:
const preBalance = await ethGetBalance(account);
await this.contract.withdrawPayments(account);
const postBalance = await ethGetBalance(count);
postBalance.sub(preBalance).should.be.bignumber.equal(value);
We should develop a test helper to take care of that (e.g. by receiving a function to await on, and then return the balance difference):
(await balanceDifference(account, () => this.contract.wihtdrawPayments(account)))
.should.be.bignumber.equal(value);
It's been mentioned that we have the following pattern in multiple parts of our test suite:
We should develop a test helper to take care of that (e.g. by receiving a function to await on, and then return the balance difference):