Feature/use expect event in test logs assertions #1232 (#1343)

* Add BigNumber support to expectEvent/inLogs (#1026)

* switched direct logs array check to expectEvent method in AllowanceCrowdsale.test.js

* Refactor expectEvent.inLogs function to use simple value number check

* Introduced should.be.bignumber method to compare BigNumber values

* Use expectEvent to test logs (#1232)

* Removed trailing space

(cherry picked from commit 536262f2ec)
This commit is contained in:
Jakub Bogacz
2018-09-27 16:33:28 +02:00
committed by Leo Arias
parent a9af619c59
commit 39db4b4b05
12 changed files with 135 additions and 134 deletions

View File

@ -1,3 +1,4 @@
const expectEvent = require('../../helpers/expectEvent');
const { assertRevert } = require('../../helpers/assertRevert');
const ERC20PausableMock = artifacts.require('ERC20PausableMock');
@ -30,8 +31,7 @@ contract('ERC20Pausable', function ([_, pauser, otherPauser, recipient, anotherA
it('emits a Pause event', async function () {
const { logs } = await this.token.pause({ from });
logs.length.should.equal(1);
logs[0].event.should.equal('Paused');
expectEvent.inLogs(logs, 'Paused');
});
});
@ -72,8 +72,7 @@ contract('ERC20Pausable', function ([_, pauser, otherPauser, recipient, anotherA
it('emits an Unpause event', async function () {
const { logs } = await this.token.unpause({ from });
logs.length.should.equal(1);
logs[0].event.should.equal('Unpaused');
expectEvent.inLogs(logs, 'Unpaused');
});
});