aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov/test/sol_compiler_artifact_adapter_test.ts
blob: 0ebad669ba47bb519d4e85846dbf9d86e124bf2e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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',
                ]);
            });
        });
    });
});