Replaced assertJump, assertRevert and expectThrow with shouldFail. (#1363)

* Replaced assertJump, assertRevert and expectThrow with shouldFail.

* Fixed linter errors.

* Fixed typo.

* Made the helpers async.
This commit is contained in:
Nicolás Venturo
2018-10-09 16:23:55 -03:00
committed by GitHub
parent 58a42443df
commit b0da0fded0
46 changed files with 282 additions and 352 deletions

View File

@ -1,4 +1,4 @@
const { expectThrow } = require('../../../helpers/expectThrow');
const shouldFail = require('../../../helpers/shouldFail');
const BigNumber = web3.BigNumber;
@ -21,12 +21,12 @@ function shouldBehaveLikeERC20Capped (minter, [anyone], cap) {
it('should fail to mint if the ammount exceeds the cap', async function () {
await this.token.mint(anyone, cap.sub(1), { from });
await expectThrow(this.token.mint(anyone, 100, { from }));
await shouldFail.reverting(this.token.mint(anyone, 100, { from }));
});
it('should fail to mint after cap is reached', async function () {
await this.token.mint(anyone, cap, { from });
await expectThrow(this.token.mint(anyone, 1, { from }));
await shouldFail.reverting(this.token.mint(anyone, 1, { from }));
});
});
}