From b925b2dae6c60fab3eeb07a2f3dbcda3bdaed392 Mon Sep 17 00:00:00 2001 From: Facundo Spagnuolo Date: Tue, 9 Jan 2018 12:34:29 -0300 Subject: [PATCH] Organize test files following contracts folders structure --- test/{ => crowdsale}/CappedCrowdsale.test.js | 10 +++++----- test/{ => crowdsale}/Crowdsale.test.js | 10 +++++----- test/{ => crowdsale}/FinalizableCrowdsale.test.js | 8 ++++---- test/{ => crowdsale}/RefundVault.test.js | 4 ++-- test/{ => crowdsale}/RefundableCrowdsale.test.js | 10 +++++----- test/{ => examples}/SampleCrowdsale.test.js | 10 +++++----- test/{ => lifecycle}/Destructible.test.js | 2 +- test/{ => lifecycle}/Pausable.test.js | 2 +- test/{ => lifecycle}/TokenDestructible.test.js | 2 +- test/{ => math}/SafeMath.test.js | 4 ++-- test/{ => ownership}/CanReclaimToken.test.js | 2 +- test/{ => ownership}/Claimable.test.js | 2 +- test/{ => ownership}/Contactable.test.js | 0 test/{ => ownership}/DelayedClaimble.test.js | 3 +-- test/{ => ownership}/HasNoContracts.test.js | 2 +- test/{ => ownership}/HasNoEther.test.js | 4 ++-- test/{ => ownership}/HasNoTokens.test.js | 2 +- test/{ => ownership}/Ownable.test.js | 2 +- test/{ => ownership/rbac}/RBAC.test.js | 4 ++-- test/{ => payment}/PullPayment.test.js | 0 test/{ => payment}/SplitPayment.test.js | 2 +- test/{ => token}/BasicToken.test.js | 2 +- test/{ => token}/BurnableToken.test.js | 2 +- test/{ => token}/CappedToken.test.js | 4 ++-- test/{ => token}/DetailedERC20.test.js | 0 test/{ => token}/MintableToken.test.js | 2 +- test/{ => token}/PausableToken.test.js | 2 +- test/{ => token}/SafeERC20.test.js | 2 +- test/{ => token}/StandardToken.test.js | 2 +- test/{ => token}/TokenTimelock.test.js | 4 ++-- test/{ => token}/TokenVesting.test.js | 6 +++--- 31 files changed, 55 insertions(+), 56 deletions(-) rename test/{ => crowdsale}/CappedCrowdsale.test.js (91%) rename test/{ => crowdsale}/Crowdsale.test.js (95%) rename test/{ => crowdsale}/FinalizableCrowdsale.test.js (90%) rename test/{ => crowdsale}/RefundVault.test.js (95%) rename test/{ => crowdsale}/RefundableCrowdsale.test.js (91%) rename test/{ => examples}/SampleCrowdsale.test.js (94%) rename test/{ => lifecycle}/Destructible.test.js (95%) rename test/{ => lifecycle}/Pausable.test.js (97%) rename test/{ => lifecycle}/TokenDestructible.test.js (97%) rename test/{ => math}/SafeMath.test.js (93%) rename test/{ => ownership}/CanReclaimToken.test.js (96%) rename test/{ => ownership}/Claimable.test.js (96%) rename test/{ => ownership}/Contactable.test.js (100%) rename test/{ => ownership}/DelayedClaimble.test.js (97%) rename test/{ => ownership}/HasNoContracts.test.js (95%) rename test/{ => ownership}/HasNoEther.test.js (95%) rename test/{ => ownership}/HasNoTokens.test.js (96%) rename test/{ => ownership}/Ownable.test.js (95%) rename test/{ => ownership/rbac}/RBAC.test.js (96%) rename test/{ => payment}/PullPayment.test.js (100%) rename test/{ => payment}/SplitPayment.test.js (98%) rename test/{ => token}/BasicToken.test.js (95%) rename test/{ => token}/BurnableToken.test.js (95%) rename test/{ => token}/CappedToken.test.js (91%) rename test/{ => token}/DetailedERC20.test.js (100%) rename test/{ => token}/MintableToken.test.js (96%) rename test/{ => token}/PausableToken.test.js (97%) rename test/{ => token}/SafeERC20.test.js (96%) rename test/{ => token}/StandardToken.test.js (98%) rename test/{ => token}/TokenTimelock.test.js (94%) rename test/{ => token}/TokenVesting.test.js (96%) diff --git a/test/CappedCrowdsale.test.js b/test/crowdsale/CappedCrowdsale.test.js similarity index 91% rename from test/CappedCrowdsale.test.js rename to test/crowdsale/CappedCrowdsale.test.js index 5f361da68ea..0200250008b 100644 --- a/test/CappedCrowdsale.test.js +++ b/test/crowdsale/CappedCrowdsale.test.js @@ -1,8 +1,8 @@ -import ether from './helpers/ether'; -import { advanceBlock } from './helpers/advanceToBlock'; -import { increaseTimeTo, duration } from './helpers/increaseTime'; -import latestTime from './helpers/latestTime'; -import EVMRevert from './helpers/EVMRevert'; +import ether from '../helpers/ether'; +import { advanceBlock } from '../helpers/advanceToBlock'; +import { increaseTimeTo, duration } from '../helpers/increaseTime'; +import latestTime from '../helpers/latestTime'; +import EVMRevert from '../helpers/EVMRevert'; const BigNumber = web3.BigNumber; diff --git a/test/Crowdsale.test.js b/test/crowdsale/Crowdsale.test.js similarity index 95% rename from test/Crowdsale.test.js rename to test/crowdsale/Crowdsale.test.js index 7d8555e5f11..ef6f248d593 100644 --- a/test/Crowdsale.test.js +++ b/test/crowdsale/Crowdsale.test.js @@ -1,8 +1,8 @@ -import ether from './helpers/ether'; -import { advanceBlock } from './helpers/advanceToBlock'; -import { increaseTimeTo, duration } from './helpers/increaseTime'; -import latestTime from './helpers/latestTime'; -import EVMRevert from './helpers/EVMRevert'; +import ether from '../helpers/ether'; +import { advanceBlock } from '../helpers/advanceToBlock'; +import { increaseTimeTo, duration } from '../helpers/increaseTime'; +import latestTime from '../helpers/latestTime'; +import EVMRevert from '../helpers/EVMRevert'; const BigNumber = web3.BigNumber; diff --git a/test/FinalizableCrowdsale.test.js b/test/crowdsale/FinalizableCrowdsale.test.js similarity index 90% rename from test/FinalizableCrowdsale.test.js rename to test/crowdsale/FinalizableCrowdsale.test.js index 4b97665c7fc..39988663a29 100644 --- a/test/FinalizableCrowdsale.test.js +++ b/test/crowdsale/FinalizableCrowdsale.test.js @@ -1,7 +1,7 @@ -import { advanceBlock } from './helpers/advanceToBlock'; -import { increaseTimeTo, duration } from './helpers/increaseTime'; -import latestTime from './helpers/latestTime'; -import EVMRevert from './helpers/EVMRevert'; +import { advanceBlock } from '../helpers/advanceToBlock'; +import { increaseTimeTo, duration } from '../helpers/increaseTime'; +import latestTime from '../helpers/latestTime'; +import EVMRevert from '../helpers/EVMRevert'; const BigNumber = web3.BigNumber; diff --git a/test/RefundVault.test.js b/test/crowdsale/RefundVault.test.js similarity index 95% rename from test/RefundVault.test.js rename to test/crowdsale/RefundVault.test.js index 0ce1dd74c68..e3b88dfcede 100644 --- a/test/RefundVault.test.js +++ b/test/crowdsale/RefundVault.test.js @@ -1,5 +1,5 @@ -import ether from './helpers/ether'; -import EVMRevert from './helpers/EVMRevert'; +import ether from '../helpers/ether'; +import EVMRevert from '../helpers/EVMRevert'; const BigNumber = web3.BigNumber; diff --git a/test/RefundableCrowdsale.test.js b/test/crowdsale/RefundableCrowdsale.test.js similarity index 91% rename from test/RefundableCrowdsale.test.js rename to test/crowdsale/RefundableCrowdsale.test.js index f91a06f654a..54347826cc1 100644 --- a/test/RefundableCrowdsale.test.js +++ b/test/crowdsale/RefundableCrowdsale.test.js @@ -1,8 +1,8 @@ -import ether from './helpers/ether'; -import { advanceBlock } from './helpers/advanceToBlock'; -import { increaseTimeTo, duration } from './helpers/increaseTime'; -import latestTime from './helpers/latestTime'; -import EVMRevert from './helpers/EVMRevert'; +import ether from '../helpers/ether'; +import { advanceBlock } from '../helpers/advanceToBlock'; +import { increaseTimeTo, duration } from '../helpers/increaseTime'; +import latestTime from '../helpers/latestTime'; +import EVMRevert from '../helpers/EVMRevert'; const BigNumber = web3.BigNumber; diff --git a/test/SampleCrowdsale.test.js b/test/examples/SampleCrowdsale.test.js similarity index 94% rename from test/SampleCrowdsale.test.js rename to test/examples/SampleCrowdsale.test.js index 9e3970ed817..b2f9ee26ef5 100644 --- a/test/SampleCrowdsale.test.js +++ b/test/examples/SampleCrowdsale.test.js @@ -1,8 +1,8 @@ -import ether from './helpers/ether'; -import { advanceBlock } from './helpers/advanceToBlock'; -import { increaseTimeTo, duration } from './helpers/increaseTime'; -import latestTime from './helpers/latestTime'; -import EVMRevert from './helpers/EVMRevert'; +import ether from '../helpers/ether'; +import { advanceBlock } from '../helpers/advanceToBlock'; +import { increaseTimeTo, duration } from '../helpers/increaseTime'; +import latestTime from '../helpers/latestTime'; +import EVMRevert from '../helpers/EVMRevert'; const BigNumber = web3.BigNumber; diff --git a/test/Destructible.test.js b/test/lifecycle/Destructible.test.js similarity index 95% rename from test/Destructible.test.js rename to test/lifecycle/Destructible.test.js index da02021f299..fd346eda803 100644 --- a/test/Destructible.test.js +++ b/test/lifecycle/Destructible.test.js @@ -1,6 +1,6 @@ var Destructible = artifacts.require('../contracts/lifecycle/Destructible.sol'); -require('./helpers/transactionMined.js'); +require('../helpers/transactionMined.js'); contract('Destructible', function (accounts) { it('should send balance to owner after destruction', async function () { diff --git a/test/Pausable.test.js b/test/lifecycle/Pausable.test.js similarity index 97% rename from test/Pausable.test.js rename to test/lifecycle/Pausable.test.js index b5cd63694ba..8aefc3633da 100644 --- a/test/Pausable.test.js +++ b/test/lifecycle/Pausable.test.js @@ -1,5 +1,5 @@ -import assertRevert from './helpers/assertRevert'; +import assertRevert from '../helpers/assertRevert'; const PausableMock = artifacts.require('mocks/PausableMock.sol'); contract('Pausable', function (accounts) { diff --git a/test/TokenDestructible.test.js b/test/lifecycle/TokenDestructible.test.js similarity index 97% rename from test/TokenDestructible.test.js rename to test/lifecycle/TokenDestructible.test.js index 6a646bf9223..4ba6e551cd0 100644 --- a/test/TokenDestructible.test.js +++ b/test/lifecycle/TokenDestructible.test.js @@ -1,7 +1,7 @@ var TokenDestructible = artifacts.require('../contracts/lifecycle/TokenDestructible.sol'); var StandardTokenMock = artifacts.require('mocks/StandardTokenMock.sol'); -require('./helpers/transactionMined.js'); +require('../helpers/transactionMined.js'); contract('TokenDestructible', function (accounts) { let destructible; diff --git a/test/SafeMath.test.js b/test/math/SafeMath.test.js similarity index 93% rename from test/SafeMath.test.js rename to test/math/SafeMath.test.js index a1150ffd925..826c6c19429 100644 --- a/test/SafeMath.test.js +++ b/test/math/SafeMath.test.js @@ -1,5 +1,5 @@ -import assertRevert from './helpers/assertRevert'; -const assertJump = require('./helpers/assertJump'); +import assertRevert from '../helpers/assertRevert'; +const assertJump = require('../helpers/assertJump'); var SafeMathMock = artifacts.require('mocks/SafeMathMock.sol'); contract('SafeMath', function (accounts) { diff --git a/test/CanReclaimToken.test.js b/test/ownership/CanReclaimToken.test.js similarity index 96% rename from test/CanReclaimToken.test.js rename to test/ownership/CanReclaimToken.test.js index 1b7f88f2006..ba803b18f31 100644 --- a/test/CanReclaimToken.test.js +++ b/test/ownership/CanReclaimToken.test.js @@ -1,5 +1,5 @@ -import expectThrow from './helpers/expectThrow'; +import expectThrow from '../helpers/expectThrow'; const CanReclaimToken = artifacts.require('../contracts/ownership/CanReclaimToken.sol'); const BasicTokenMock = artifacts.require('mocks/BasicTokenMock.sol'); diff --git a/test/Claimable.test.js b/test/ownership/Claimable.test.js similarity index 96% rename from test/Claimable.test.js rename to test/ownership/Claimable.test.js index 6683ee6abc0..acf27bfccba 100644 --- a/test/Claimable.test.js +++ b/test/ownership/Claimable.test.js @@ -1,5 +1,5 @@ -import assertRevert from './helpers/assertRevert'; +import assertRevert from '../helpers/assertRevert'; var Claimable = artifacts.require('../contracts/ownership/Claimable.sol'); diff --git a/test/Contactable.test.js b/test/ownership/Contactable.test.js similarity index 100% rename from test/Contactable.test.js rename to test/ownership/Contactable.test.js diff --git a/test/DelayedClaimble.test.js b/test/ownership/DelayedClaimble.test.js similarity index 97% rename from test/DelayedClaimble.test.js rename to test/ownership/DelayedClaimble.test.js index c5346d0f5a3..59164293d52 100644 --- a/test/DelayedClaimble.test.js +++ b/test/ownership/DelayedClaimble.test.js @@ -1,5 +1,4 @@ - -import assertRevert from './helpers/assertRevert'; +import assertRevert from '../helpers/assertRevert'; var DelayedClaimable = artifacts.require('../contracts/ownership/DelayedClaimable.sol'); diff --git a/test/HasNoContracts.test.js b/test/ownership/HasNoContracts.test.js similarity index 95% rename from test/HasNoContracts.test.js rename to test/ownership/HasNoContracts.test.js index e2743731f99..03f3948f872 100644 --- a/test/HasNoContracts.test.js +++ b/test/ownership/HasNoContracts.test.js @@ -1,5 +1,5 @@ -import expectThrow from './helpers/expectThrow'; +import expectThrow from '../helpers/expectThrow'; const Ownable = artifacts.require('../contracts/ownership/Ownable.sol'); const HasNoContracts = artifacts.require( diff --git a/test/HasNoEther.test.js b/test/ownership/HasNoEther.test.js similarity index 95% rename from test/HasNoEther.test.js rename to test/ownership/HasNoEther.test.js index e7ec486a1dd..eeab02d10ad 100644 --- a/test/HasNoEther.test.js +++ b/test/ownership/HasNoEther.test.js @@ -1,6 +1,6 @@ -import expectThrow from './helpers/expectThrow'; -import toPromise from './helpers/toPromise'; +import expectThrow from '../helpers/expectThrow'; +import toPromise from '../helpers/toPromise'; const HasNoEtherTest = artifacts.require('../mocks/HasNoEtherTest.sol'); const ForceEther = artifacts.require('../mocks/ForceEther.sol'); diff --git a/test/HasNoTokens.test.js b/test/ownership/HasNoTokens.test.js similarity index 96% rename from test/HasNoTokens.test.js rename to test/ownership/HasNoTokens.test.js index be5a26ad40f..e6622a16dff 100644 --- a/test/HasNoTokens.test.js +++ b/test/ownership/HasNoTokens.test.js @@ -1,5 +1,5 @@ -import expectThrow from './helpers/expectThrow'; +import expectThrow from '../helpers/expectThrow'; const HasNoTokens = artifacts.require('../contracts/lifecycle/HasNoTokens.sol'); const ERC23TokenMock = artifacts.require('mocks/ERC23TokenMock.sol'); diff --git a/test/Ownable.test.js b/test/ownership/Ownable.test.js similarity index 95% rename from test/Ownable.test.js rename to test/ownership/Ownable.test.js index 226e68bbfd5..53cd0d2a023 100644 --- a/test/Ownable.test.js +++ b/test/ownership/Ownable.test.js @@ -1,5 +1,5 @@ -import assertRevert from './helpers/assertRevert'; +import assertRevert from '../helpers/assertRevert'; var Ownable = artifacts.require('../contracts/ownership/Ownable.sol'); diff --git a/test/RBAC.test.js b/test/ownership/rbac/RBAC.test.js similarity index 96% rename from test/RBAC.test.js rename to test/ownership/rbac/RBAC.test.js index 9fc2ee7f1e2..00dc74e7001 100644 --- a/test/RBAC.test.js +++ b/test/ownership/rbac/RBAC.test.js @@ -1,5 +1,5 @@ -import expectThrow from './helpers/expectThrow'; -import expectEvent from './helpers/expectEvent'; +import expectThrow from '../../helpers/expectThrow'; +import expectEvent from '../../helpers/expectEvent'; const RBACMock = artifacts.require('mocks/RBACMock.sol'); diff --git a/test/PullPayment.test.js b/test/payment/PullPayment.test.js similarity index 100% rename from test/PullPayment.test.js rename to test/payment/PullPayment.test.js diff --git a/test/SplitPayment.test.js b/test/payment/SplitPayment.test.js similarity index 98% rename from test/SplitPayment.test.js rename to test/payment/SplitPayment.test.js index 0a8987ea439..60257b4d962 100644 --- a/test/SplitPayment.test.js +++ b/test/payment/SplitPayment.test.js @@ -5,7 +5,7 @@ require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -const EVMThrow = require('./helpers/EVMThrow.js'); +const EVMThrow = require('../helpers/EVMThrow.js'); const SplitPayment = artifacts.require('../contracts/payment/SplitPayment.sol'); contract('SplitPayment', function ([owner, payee1, payee2, payee3, nonpayee1, payer1]) { diff --git a/test/BasicToken.test.js b/test/token/BasicToken.test.js similarity index 95% rename from test/BasicToken.test.js rename to test/token/BasicToken.test.js index 54abc805a16..7391096f440 100644 --- a/test/BasicToken.test.js +++ b/test/token/BasicToken.test.js @@ -1,4 +1,4 @@ -import assertRevert from './helpers/assertRevert'; +import assertRevert from '../helpers/assertRevert'; var BasicTokenMock = artifacts.require('mocks/BasicTokenMock.sol'); diff --git a/test/BurnableToken.test.js b/test/token/BurnableToken.test.js similarity index 95% rename from test/BurnableToken.test.js rename to test/token/BurnableToken.test.js index 25875e98e82..91b470d4ffe 100644 --- a/test/BurnableToken.test.js +++ b/test/token/BurnableToken.test.js @@ -1,5 +1,5 @@ -const EVMRevert = require('./helpers/EVMRevert.js'); +const EVMRevert = require('../helpers/EVMRevert.js'); const BurnableTokenMock = artifacts.require('mocks/BurnableTokenMock.sol'); const BigNumber = web3.BigNumber; diff --git a/test/CappedToken.test.js b/test/token/CappedToken.test.js similarity index 91% rename from test/CappedToken.test.js rename to test/token/CappedToken.test.js index d015c19118d..2dc932420b2 100644 --- a/test/CappedToken.test.js +++ b/test/token/CappedToken.test.js @@ -1,6 +1,6 @@ -import expectThrow from './helpers/expectThrow'; -import ether from './helpers/ether'; +import expectThrow from '../helpers/expectThrow'; +import ether from '../helpers/ether'; var CappedToken = artifacts.require('../contracts/Tokens/CappedToken.sol'); diff --git a/test/DetailedERC20.test.js b/test/token/DetailedERC20.test.js similarity index 100% rename from test/DetailedERC20.test.js rename to test/token/DetailedERC20.test.js diff --git a/test/MintableToken.test.js b/test/token/MintableToken.test.js similarity index 96% rename from test/MintableToken.test.js rename to test/token/MintableToken.test.js index ba287a3672e..38ea5d99d9b 100644 --- a/test/MintableToken.test.js +++ b/test/token/MintableToken.test.js @@ -1,5 +1,5 @@ -import expectThrow from './helpers/expectThrow'; +import expectThrow from '../helpers/expectThrow'; var MintableToken = artifacts.require('../contracts/Tokens/MintableToken.sol'); contract('Mintable', function (accounts) { diff --git a/test/PausableToken.test.js b/test/token/PausableToken.test.js similarity index 97% rename from test/PausableToken.test.js rename to test/token/PausableToken.test.js index 3fe7230940e..33228e217be 100644 --- a/test/PausableToken.test.js +++ b/test/token/PausableToken.test.js @@ -1,6 +1,6 @@ 'user strict'; -import assertRevert from './helpers/assertRevert'; +import assertRevert from '../helpers/assertRevert'; var PausableTokenMock = artifacts.require('./mocks/PausableTokenMock.sol'); contract('PausableToken', function (accounts) { diff --git a/test/SafeERC20.test.js b/test/token/SafeERC20.test.js similarity index 96% rename from test/SafeERC20.test.js rename to test/token/SafeERC20.test.js index 8437fcc467c..0602e08ffba 100644 --- a/test/SafeERC20.test.js +++ b/test/token/SafeERC20.test.js @@ -1,4 +1,4 @@ -import EVMThrow from './helpers/EVMThrow'; +import EVMThrow from '../helpers/EVMThrow'; require('chai') .use(require('chai-as-promised')) diff --git a/test/StandardToken.test.js b/test/token/StandardToken.test.js similarity index 98% rename from test/StandardToken.test.js rename to test/token/StandardToken.test.js index 10eb30a7e6f..f6726a29225 100644 --- a/test/StandardToken.test.js +++ b/test/token/StandardToken.test.js @@ -1,5 +1,5 @@ -import assertRevert from './helpers/assertRevert'; +import assertRevert from '../helpers/assertRevert'; var StandardTokenMock = artifacts.require('mocks/StandardTokenMock.sol'); diff --git a/test/TokenTimelock.test.js b/test/token/TokenTimelock.test.js similarity index 94% rename from test/TokenTimelock.test.js rename to test/token/TokenTimelock.test.js index d7fbab990d9..1ce9ef2985f 100644 --- a/test/TokenTimelock.test.js +++ b/test/token/TokenTimelock.test.js @@ -1,5 +1,5 @@ -import latestTime from './helpers/latestTime'; -import { increaseTimeTo, duration } from './helpers/increaseTime'; +import latestTime from '../helpers/latestTime'; +import { increaseTimeTo, duration } from '../helpers/increaseTime'; const BigNumber = web3.BigNumber; diff --git a/test/TokenVesting.test.js b/test/token/TokenVesting.test.js similarity index 96% rename from test/TokenVesting.test.js rename to test/token/TokenVesting.test.js index e767ae1a811..8487576fe46 100644 --- a/test/TokenVesting.test.js +++ b/test/token/TokenVesting.test.js @@ -1,6 +1,6 @@ -import EVMRevert from './helpers/EVMRevert'; -import latestTime from './helpers/latestTime'; -import { increaseTimeTo, duration } from './helpers/increaseTime'; +import EVMRevert from '../helpers/EVMRevert'; +import latestTime from '../helpers/latestTime'; +import { increaseTimeTo, duration } from '../helpers/increaseTime'; const BigNumber = web3.BigNumber;