Replaced assertJump, assertRevert and expectThrow with shouldFail. (#1363)
* Replaced assertJump, assertRevert and expectThrow with shouldFail.
* Fixed linter errors.
* Fixed typo.
* Made the helpers async.
(cherry picked from commit b0da0fded0)
This commit is contained in:
committed by
Leo Arias
parent
620d524398
commit
7cd0d5a452
@ -1,5 +1,6 @@
|
||||
const { assertRevert } = require('../helpers/assertRevert');
|
||||
const shouldFail = require('../helpers/shouldFail');
|
||||
const { ZERO_ADDRESS } = require('../helpers/constants');
|
||||
|
||||
const RolesMock = artifacts.require('RolesMock');
|
||||
|
||||
require('chai')
|
||||
@ -11,7 +12,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) {
|
||||
});
|
||||
|
||||
it('reverts when querying roles for the null account', async function () {
|
||||
await assertRevert(this.roles.has(ZERO_ADDRESS));
|
||||
await shouldFail.reverting(this.roles.has(ZERO_ADDRESS));
|
||||
});
|
||||
|
||||
context('initially', function () {
|
||||
@ -35,7 +36,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) {
|
||||
});
|
||||
|
||||
it('reverts when adding roles to the null account', async function () {
|
||||
await assertRevert(this.roles.add(ZERO_ADDRESS));
|
||||
await shouldFail.reverting(this.roles.add(ZERO_ADDRESS));
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -58,7 +59,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) {
|
||||
});
|
||||
|
||||
it('reverts when removing roles from the null account', async function () {
|
||||
await assertRevert(this.roles.remove(ZERO_ADDRESS));
|
||||
await shouldFail.reverting(this.roles.remove(ZERO_ADDRESS));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user