From 4fbd44fd406c592e392ebf8a8113126a9f090d08 Mon Sep 17 00:00:00 2001 From: AugustoL Date: Wed, 17 Jan 2018 15:33:42 -0300 Subject: [PATCH] Reorganize tests and add library folder --- test/{ => examples}/SimpleToken.test.js | 6 +++--- test/{ => library}/ECRecovery.test.js | 6 +++--- test/{ => library}/Math.test.js | 2 +- test/{ => library}/MerkleProof.test.js | 4 ++-- test/token/{ => erc}/DetailedERC20.test.js | 2 +- test/{ => token/erc}/ERC827Token.js | 6 +++--- test/token/{ => erc}/SafeERC20.test.js | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) rename test/{ => examples}/SimpleToken.test.js (90%) rename test/{ => library}/ECRecovery.test.js (92%) rename test/{ => library}/Math.test.js (89%) rename test/{ => library}/MerkleProof.test.js (94%) rename test/token/{ => erc}/DetailedERC20.test.js (91%) rename test/{ => token/erc}/ERC827Token.js (98%) rename test/token/{ => erc}/SafeERC20.test.js (90%) diff --git a/test/SimpleToken.test.js b/test/examples/SimpleToken.test.js similarity index 90% rename from test/SimpleToken.test.js rename to test/examples/SimpleToken.test.js index 9a1870f20..8d4c33091 100644 --- a/test/SimpleToken.test.js +++ b/test/examples/SimpleToken.test.js @@ -1,5 +1,5 @@ -import decodeLogs from './helpers/decodeLogs'; -const SimpleToken = artifacts.require('examples/SimpleToken.sol'); +import decodeLogs from '../helpers/decodeLogs'; +const SimpleToken = artifacts.require('SimpleToken.sol'); contract('SimpleToken', accounts => { let token; @@ -23,7 +23,7 @@ contract('SimpleToken', accounts => { const decimals = await token.decimals(); assert(decimals.eq(18)); }); - + it('assigns the initial total supply to the creator', async function () { const totalSupply = await token.totalSupply(); const creatorBalance = await token.balanceOf(creator); diff --git a/test/ECRecovery.test.js b/test/library/ECRecovery.test.js similarity index 92% rename from test/ECRecovery.test.js rename to test/library/ECRecovery.test.js index 927441f4b..ae69f42cf 100644 --- a/test/ECRecovery.test.js +++ b/test/library/ECRecovery.test.js @@ -1,7 +1,7 @@ -var ECRecoveryMock = artifacts.require('../contracts/mocks/ECRecoveryMock.sol'); -var ECRecoveryLib = artifacts.require('../contracts/ECRecovery.sol'); +var ECRecoveryMock = artifacts.require('ECRecoveryMock.sol'); +var ECRecoveryLib = artifacts.require('ECRecovery.sol'); -var hashMessage = require('./helpers/hashMessage.js'); +var hashMessage = require('../helpers/hashMessage.js'); contract('ECRecovery', function (accounts) { let ecrecovery; diff --git a/test/Math.test.js b/test/library/Math.test.js similarity index 89% rename from test/Math.test.js rename to test/library/Math.test.js index 7378610b6..b112646a0 100644 --- a/test/Math.test.js +++ b/test/library/Math.test.js @@ -1,4 +1,4 @@ -var MathMock = artifacts.require('./mocks/MathMock.sol'); +var MathMock = artifacts.require('../mocks/MathMock.sol'); contract('Math', function (accounts) { let math; diff --git a/test/MerkleProof.test.js b/test/library/MerkleProof.test.js similarity index 94% rename from test/MerkleProof.test.js rename to test/library/MerkleProof.test.js index f55d6ebc8..9d464401f 100644 --- a/test/MerkleProof.test.js +++ b/test/library/MerkleProof.test.js @@ -1,8 +1,8 @@ -import MerkleTree from './helpers/merkleTree.js'; +import MerkleTree from '../helpers/merkleTree.js'; import { sha3, bufferToHex } from 'ethereumjs-util'; -var MerkleProof = artifacts.require('./MerkleProof.sol'); +var MerkleProof = artifacts.require('MerkleProof.sol'); contract('MerkleProof', function (accounts) { let merkleProof; diff --git a/test/token/DetailedERC20.test.js b/test/token/erc/DetailedERC20.test.js similarity index 91% rename from test/token/DetailedERC20.test.js rename to test/token/erc/DetailedERC20.test.js index 16155a4b8..cfb1d1e71 100644 --- a/test/token/DetailedERC20.test.js +++ b/test/token/erc/DetailedERC20.test.js @@ -5,7 +5,7 @@ require('chai') .use(require('chai-bignumber')(BigNumber)) .should(); -const DetailedERC20Mock = artifacts.require('mocks/DetailedERC20Mock.sol'); +const DetailedERC20Mock = artifacts.require('DetailedERC20Mock.sol'); contract('DetailedERC20', accounts => { let detailedERC20 = null; diff --git a/test/ERC827Token.js b/test/token/erc/ERC827Token.js similarity index 98% rename from test/ERC827Token.js rename to test/token/erc/ERC827Token.js index a88540ba6..302cca7dd 100644 --- a/test/ERC827Token.js +++ b/test/token/erc/ERC827Token.js @@ -1,7 +1,7 @@ -import EVMRevert from './helpers/EVMRevert'; -var Message = artifacts.require('./mock/MessageHelper.sol'); -var ERC827TokenMock = artifacts.require('./mock/ERC827TokenMock.sol'); +import EVMRevert from '../../helpers/EVMRevert'; +var Message = artifacts.require('MessageHelper.sol'); +var ERC827TokenMock = artifacts.require('ERC827TokenMock.sol'); var BigNumber = web3.BigNumber; var _ = require('lodash'); diff --git a/test/token/SafeERC20.test.js b/test/token/erc/SafeERC20.test.js similarity index 90% rename from test/token/SafeERC20.test.js rename to test/token/erc/SafeERC20.test.js index 0602e08ff..40a43e1a7 100644 --- a/test/token/SafeERC20.test.js +++ b/test/token/erc/SafeERC20.test.js @@ -1,10 +1,10 @@ -import EVMThrow from '../helpers/EVMThrow'; +import EVMThrow from '../../helpers/EVMThrow'; require('chai') .use(require('chai-as-promised')) .should(); -const SafeERC20Helper = artifacts.require('mocks/SafeERC20Helper.sol'); +const SafeERC20Helper = artifacts.require('SafeERC20Helper.sol'); contract('SafeERC20', function () { beforeEach(async function () {