diff options
author | Jacob Evans <dekz@dekz.net> | 2018-04-17 11:47:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-17 11:47:57 +0800 |
commit | 79d01fe2d7582266dafedefee2873c9d488f4a20 (patch) | |
tree | 5a6dbbf7fcb1dced1ace80c03343ca789dc49b54 /packages/deployer/test/compiler_utils_test.ts | |
parent | 0d02037a129a97b6afb724a5316d54730c93c0d8 (diff) | |
parent | d263f7783fabe89cc9714b596068eccdc5babc1c (diff) | |
download | dexon-sol-tools-79d01fe2d7582266dafedefee2873c9d488f4a20.tar dexon-sol-tools-79d01fe2d7582266dafedefee2873c9d488f4a20.tar.gz dexon-sol-tools-79d01fe2d7582266dafedefee2873c9d488f4a20.tar.bz2 dexon-sol-tools-79d01fe2d7582266dafedefee2873c9d488f4a20.tar.lz dexon-sol-tools-79d01fe2d7582266dafedefee2873c9d488f4a20.tar.xz dexon-sol-tools-79d01fe2d7582266dafedefee2873c9d488f4a20.tar.zst dexon-sol-tools-79d01fe2d7582266dafedefee2873c9d488f4a20.zip |
Merge branch 'development' into feature/0x.js/remove-hd-wallet-from-test
Diffstat (limited to 'packages/deployer/test/compiler_utils_test.ts')
-rw-r--r-- | packages/deployer/test/compiler_utils_test.ts | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/packages/deployer/test/compiler_utils_test.ts b/packages/deployer/test/compiler_utils_test.ts index 5377d3308..e2b95f289 100644 --- a/packages/deployer/test/compiler_utils_test.ts +++ b/packages/deployer/test/compiler_utils_test.ts @@ -47,34 +47,31 @@ describe('Compiler utils', () => { }); describe('#parseDependencies', () => { it('correctly parses Exchange dependencies', async () => { - const exchangeSource = await fsWrapper.readFileAsync(`${__dirname}/fixtures/contracts/main/Exchange.sol`, { + const path = `${__dirname}/fixtures/contracts/Exchange.sol`; + const source = await fsWrapper.readFileAsync(path, { encoding: 'utf8', }); - const sourceFileId = '/main/Exchange.sol'; - expect(parseDependencies(exchangeSource, sourceFileId)).to.be.deep.equal([ - '/main/TokenTransferProxy.sol', - '/base/Token.sol', - '/base/SafeMath.sol', + expect(parseDependencies({ source, path })).to.be.deep.equal([ + 'zeppelin-solidity/contracts/token/ERC20/ERC20.sol', + '/home/circleci/repo/packages/deployer/lib/test/fixtures/contracts/TokenTransferProxy.sol', + '/home/circleci/repo/packages/deployer/lib/test/fixtures/contracts/base/SafeMath.sol', ]); }); it('correctly parses TokenTransferProxy dependencies', async () => { - const exchangeSource = await fsWrapper.readFileAsync( - `${__dirname}/fixtures/contracts/main/TokenTransferProxy.sol`, - { - encoding: 'utf8', - }, - ); - const sourceFileId = '/main/TokenTransferProxy.sol'; - expect(parseDependencies(exchangeSource, sourceFileId)).to.be.deep.equal([ - '/base/Token.sol', - '/base/Ownable.sol', + const path = `${__dirname}/fixtures/contracts/TokenTransferProxy.sol`; + const source = await fsWrapper.readFileAsync(path, { + encoding: 'utf8', + }); + expect(parseDependencies({ source, path })).to.be.deep.equal([ + 'zeppelin-solidity/contracts/ownership/Ownable.sol', + 'zeppelin-solidity/contracts/token/ERC20/ERC20.sol', ]); }); // TODO: For now that doesn't work. This will work after we switch to a grammar-based parser it.skip('correctly parses commented out dependencies', async () => { - const contractWithCommentedOutDependencies = `// import "./TokenTransferProxy.sol";`; - const sourceFileId = '/main/TokenTransferProxy.sol'; - expect(parseDependencies(contractWithCommentedOutDependencies, sourceFileId)).to.be.deep.equal([]); + const path = ''; + const source = `// import "./TokenTransferProxy.sol";`; + expect(parseDependencies({ path, source })).to.be.deep.equal([]); }); }); }); |