Replace all asserts with chai.should (#1183)
* Moving towards chai.should. * Fixed failing tests. * Fixed linter errors. * Revert package-lock.json changes. * Fixed failing tests. * s/eq/equal * Addressed review comment
This commit is contained in:
committed by
Francisco Giordano
parent
a2e7103869
commit
ac91af9a6a
@ -2,6 +2,12 @@ const { assertRevert } = require('../helpers/assertRevert');
|
||||
|
||||
const Claimable = artifacts.require('Claimable');
|
||||
|
||||
const BigNumber = web3.BigNumber;
|
||||
|
||||
require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
contract('Claimable', function ([_, owner, newOwner, anyone]) {
|
||||
let claimable;
|
||||
|
||||
@ -9,11 +15,16 @@ contract('Claimable', function ([_, owner, newOwner, anyone]) {
|
||||
claimable = await Claimable.new({ from: owner });
|
||||
});
|
||||
|
||||
it('should have an owner', async function () {
|
||||
const owner = await claimable.owner();
|
||||
owner.should.not.eq(0);
|
||||
});
|
||||
|
||||
it('changes pendingOwner after transfer', async function () {
|
||||
await claimable.transferOwnership(newOwner, { from: owner });
|
||||
const pendingOwner = await claimable.pendingOwner();
|
||||
|
||||
assert.isTrue(pendingOwner === newOwner);
|
||||
pendingOwner.should.eq(newOwner);
|
||||
});
|
||||
|
||||
it('should prevent to claimOwnership from anyone', async function () {
|
||||
@ -31,7 +42,8 @@ contract('Claimable', function ([_, owner, newOwner, anyone]) {
|
||||
|
||||
it('changes allow pending owner to claim ownership', async function () {
|
||||
await claimable.claimOwnership({ from: newOwner });
|
||||
assert.isTrue((await claimable.owner()) === newOwner);
|
||||
|
||||
(await claimable.owner()).should.eq(newOwner);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user