aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov/test/collect_contracts_data_test.ts
blob: e793085e3e100b790081a8a05637198db10ed6ec (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 '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',
                ]);
            });
        });
    });
});