Skip to content

Add test helper to check balance difference #1355

@nventuro

Description

@nventuro

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueLow hanging fruit for new contributors to get involved!testsTest suite and helpers.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions