aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov/test/collect_contracts_data_test.ts
diff options
context:
space:
mode:
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',
+ ]);
+ });
+ });
+ });
+});