aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov/test/sol_compiler_artifact_adapter_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sol-cov/test/sol_compiler_artifact_adapter_test.ts')
-rw-r--r--packages/sol-cov/test/sol_compiler_artifact_adapter_test.ts30
1 files changed, 30 insertions, 0 deletions
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',
+ ]);
+ });
+ });
+ });
+});