aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov/test/collect_contracts_data_test.ts
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-03-20 00:56:46 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-03-20 00:56:46 +0800
commit11bac66046e10cd152d328f03f97e04c10d9a40c (patch)
tree926741e9383264f5c121dc8f046adfabde699eec /packages/sol-cov/test/collect_contracts_data_test.ts
parente4ea6e1ec3693b2106b1ba28869277488ebca6d3 (diff)
parent2a438419ab3bc32dba43918cf2eb480439ef81de (diff)
downloaddexon-sol-tools-11bac66046e10cd152d328f03f97e04c10d9a40c.tar
dexon-sol-tools-11bac66046e10cd152d328f03f97e04c10d9a40c.tar.gz
dexon-sol-tools-11bac66046e10cd152d328f03f97e04c10d9a40c.tar.bz2
dexon-sol-tools-11bac66046e10cd152d328f03f97e04c10d9a40c.tar.lz
dexon-sol-tools-11bac66046e10cd152d328f03f97e04c10d9a40c.tar.xz
dexon-sol-tools-11bac66046e10cd152d328f03f97e04c10d9a40c.tar.zst
dexon-sol-tools-11bac66046e10cd152d328f03f97e04c10d9a40c.zip
Merge branch 'development' into feature/sra-report/collection-tests
* development: (26 commits) Change title Add Blake and Zach to About page Re-size Jacob and Tom's images Manually publish 0x.js back to a working state Publish Publish Fix 0x.js assets Remove assets from connect and _bundles from packages that don't generate the folder Publish Fix packages that aren't working as expected Make new packages default to public on publish Add new public packages to top-level README Update top-level package.json Fix incorrect new versions Fix path to assets Publish Updated CHANGELOGS Fix quotation marks Add a complex test for ast visitor Move opcodes to constants ...
Diffstat (limited to 'packages/sol-cov/test/collect_contracts_data_test.ts')
-rw-r--r--packages/sol-cov/test/collect_contracts_data_test.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/packages/sol-cov/test/collect_contracts_data_test.ts b/packages/sol-cov/test/collect_contracts_data_test.ts
new file mode 100644
index 000000000..e793085e3
--- /dev/null
+++ b/packages/sol-cov/test/collect_contracts_data_test.ts
@@ -0,0 +1,30 @@
+import * as chai from 'chai';
+import * as _ from 'lodash';
+import 'mocha';
+import * as path from 'path';
+
+import { collectContractsData } from '../src/collect_contract_data';
+
+const expect = chai.expect;
+
+describe('Collect contracts data', () => {
+ describe('#collectContractsData', () => {
+ it('correctly collects contracts data', () => {
+ const artifactsPath = path.resolve(__dirname, 'fixtures/artifacts');
+ const sourcesPath = path.resolve(__dirname, 'fixtures/contracts');
+ const networkId = 50;
+ const contractsData = collectContractsData(artifactsPath, sourcesPath, networkId);
+ _.forEach(contractsData, contractData => {
+ expect(contractData).to.have.keys([
+ 'baseName',
+ 'sourceCodes',
+ 'sources',
+ 'sourceMap',
+ 'sourceMapRuntime',
+ 'bytecode',
+ 'runtimeBytecode',
+ ]);
+ });
+ });
+ });
+});