diff --git a/test/crowdsale/Crowdsale.test.js b/test/crowdsale/Crowdsale.test.js index dfcff4a96..006f7d7b5 100644 --- a/test/crowdsale/Crowdsale.test.js +++ b/test/crowdsale/Crowdsale.test.js @@ -11,7 +11,7 @@ contract('Crowdsale', function ([_, investor, wallet, purchaser]) { it('requires a non-null token', async function () { await shouldFail.reverting( - Crowdsale.new(rate, wallet, ZERO_ADDRESS) + Crowdsale.new(rate, wallet, constants.ZERO_ADDRESS) ); }); @@ -28,7 +28,7 @@ contract('Crowdsale', function ([_, investor, wallet, purchaser]) { it('requires a non-null wallet', async function () { await shouldFail.reverting( - Crowdsale.new(rate, ZERO_ADDRESS, this.token.address) + Crowdsale.new(rate, constants.ZERO_ADDRESS, this.token.address) ); }); @@ -64,7 +64,7 @@ contract('Crowdsale', function ([_, investor, wallet, purchaser]) { it('requires a non-null beneficiary', async function () { await shouldFail.reverting( - this.crowdsale.buyTokens(ZERO_ADDRESS, { value: value, from: purchaser }) + this.crowdsale.buyTokens(constants.ZERO_ADDRESS, { value: value, from: purchaser }) ); }); }); diff --git a/test/drafts/TokenVesting.test.js b/test/drafts/TokenVesting.test.js index 84a956c73..5f6d3f07a 100644 --- a/test/drafts/TokenVesting.test.js +++ b/test/drafts/TokenVesting.test.js @@ -79,8 +79,7 @@ contract('TokenVesting', function ([_, owner, beneficiary]) { it('should release proper amount after cliff', async function () { await time.increaseTo(this.start.add(this.cliffDuration)); - const { receipt } = await this.vesting.release(this.token.address); - const block = await web3.eth.getBlock(receipt.blockNumber); + await this.vesting.release(this.token.address); const releaseTime = await time.latest(); const releasedAmount = amount.mul(releaseTime.sub(this.start)).div(this.duration); diff --git a/test/examples/SampleCrowdsale.test.js b/test/examples/SampleCrowdsale.test.js index 437158fce..8292f8fb1 100644 --- a/test/examples/SampleCrowdsale.test.js +++ b/test/examples/SampleCrowdsale.test.js @@ -1,4 +1,4 @@ -const { BN, balance, ether, should, shouldFail, time } = require('openzeppelin-test-helpers');; +const { BN, balance, ether, should, shouldFail, time } = require('openzeppelin-test-helpers'); const SampleCrowdsale = artifacts.require('SampleCrowdsale'); const SampleCrowdsaleToken = artifacts.require('SampleCrowdsaleToken'); @@ -72,14 +72,14 @@ contract('SampleCrowdsale', function ([_, deployer, owner, wallet, investor]) { await time.increaseTo(this.openingTime); await this.crowdsale.send(GOAL); - (await balanceDifference(wallet, async () => { + (await balance.difference(wallet, async () => { await time.increaseTo(this.afterClosingTime); await this.crowdsale.finalize({ from: owner }); })).should.be.bignumber.equal(GOAL); }); it('should allow refunds if the goal is not reached', async function () { - (await balanceDifference(investor, async () => { + (await balance.difference(investor, async () => { await time.increaseTo(this.openingTime); await this.crowdsale.sendTransaction({ value: ether('1'), from: investor, gasPrice: 0 }); await time.increaseTo(this.afterClosingTime); diff --git a/test/examples/SimpleToken.test.js b/test/examples/SimpleToken.test.js index 307a25eb7..61d71bd3e 100644 --- a/test/examples/SimpleToken.test.js +++ b/test/examples/SimpleToken.test.js @@ -1,4 +1,4 @@ -const { constants, expectEvent } = require('openzeppelin-test-helpers');; +const { constants, expectEvent } = require('openzeppelin-test-helpers'); const SimpleToken = artifacts.require('SimpleToken'); diff --git a/test/introspection/ERC165.test.js b/test/introspection/ERC165.test.js index 8fa606aa9..64ca89eb7 100644 --- a/test/introspection/ERC165.test.js +++ b/test/introspection/ERC165.test.js @@ -1,4 +1,4 @@ -const { BN, shouldFail } = require('openzeppelin-test-helpers'); +const { shouldFail } = require('openzeppelin-test-helpers'); const { shouldSupportInterfaces } = require('./SupportsInterface.behavior'); const ERC165Mock = artifacts.require('ERC165Mock'); diff --git a/test/math/Math.test.js b/test/math/Math.test.js index c9f4aa73c..d28d66ef5 100644 --- a/test/math/Math.test.js +++ b/test/math/Math.test.js @@ -1,4 +1,4 @@ -const { BN } = require('openzeppelin-test-helpers');; +const { BN } = require('openzeppelin-test-helpers'); const MathMock = artifacts.require('MathMock'); diff --git a/test/token/ERC20/ERC20.test.js b/test/token/ERC20/ERC20.test.js index b10e1b826..858ea5c6f 100644 --- a/test/token/ERC20/ERC20.test.js +++ b/test/token/ERC20/ERC20.test.js @@ -290,7 +290,9 @@ contract('ERC20', function ([_, initialHolder, recipient, anotherAccount]) { }); it('reverts when more than the full allowance is removed', async function () { - await shouldFail.reverting(this.token.decreaseAllowance(spender, approvedAmount.addn(1), { from: initialHolder })); + await shouldFail.reverting( + this.token.decreaseAllowance(spender, approvedAmount.addn(1), { from: initialHolder }) + ); }); }); } diff --git a/test/token/ERC721/ERC721.behavior.js b/test/token/ERC721/ERC721.behavior.js index 4d5a92b94..f6f9b5325 100644 --- a/test/token/ERC721/ERC721.behavior.js +++ b/test/token/ERC721/ERC721.behavior.js @@ -169,7 +169,9 @@ function shouldBehaveLikeERC721 ( const tokensListed = await Promise.all( [0, 1].map(i => this.token.tokenOfOwnerByIndex(owner, i)) ); - tokensListed.map(t => t.toNumber()).should.have.members([firstTokenId.toNumber(), secondTokenId.toNumber()]); + tokensListed.map(t => t.toNumber()).should.have.members( + [firstTokenId.toNumber(), secondTokenId.toNumber()] + ); }); }); @@ -196,7 +198,9 @@ function shouldBehaveLikeERC721 ( context('when the address to transfer the token to is the zero address', function () { it('reverts', async function () { - await shouldFail.reverting(transferFunction.call(this, owner, constants.ZERO_ADDRESS, tokenId, { from: owner })); + await shouldFail.reverting( + transferFunction.call(this, owner, constants.ZERO_ADDRESS, tokenId, { from: owner }) + ); }); }); };