From 83c37c6a7a320326975c8afd9d49a42c9afcefd4 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 11:05:24 -0700 Subject: Address feedback --- .../test/sol_compiler_artifact_adapter_test.ts | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 packages/sol-cov/test/sol_compiler_artifact_adapter_test.ts (limited to 'packages/sol-cov/test/sol_compiler_artifact_adapter_test.ts') diff --git a/packages/sol-cov/test/sol_compiler_artifact_adapter_test.ts b/packages/sol-cov/test/sol_compiler_artifact_adapter_test.ts new file mode 100644 index 000000000..0ebad669b --- /dev/null +++ b/packages/sol-cov/test/sol_compiler_artifact_adapter_test.ts @@ -0,0 +1,30 @@ +import * as chai from 'chai'; +import * as _ from 'lodash'; +import 'make-promises-safe'; +import 'mocha'; +import * as path from 'path'; + +import { SolCompilerArtifactAdapter } from '../src/artifact_adapters/sol_compiler_artifact_adapter'; + +const expect = chai.expect; + +describe('SolCompilerArtifactAdapter', () => { + describe('#collectContractsData', () => { + it('correctly collects contracts data', async () => { + const artifactsPath = path.resolve(__dirname, 'fixtures/artifacts'); + const sourcesPath = path.resolve(__dirname, 'fixtures/contracts'); + const zeroExArtifactsAdapter = new SolCompilerArtifactAdapter(artifactsPath, sourcesPath); + const contractsData = await zeroExArtifactsAdapter.collectContractsDataAsync(); + _.forEach(contractsData, contractData => { + expect(contractData).to.have.keys([ + 'sourceCodes', + 'sources', + 'sourceMap', + 'sourceMapRuntime', + 'bytecode', + 'runtimeBytecode', + ]); + }); + }); + }); +}); -- cgit