protocol/packages/sol-tracing-utils/test/sol_compiler_artifact_adapter_test.ts
Xianny 7423028fea
Replace lodash with built-ins where possible to reduce bundle size (#1766)
* add tslint rule to disallow lodash.isUndefined

* add tslint rule to disallow lodash.isNull

* apply fixes
2019-04-10 09:36:32 -07:00

31 lines
1.1 KiB
TypeScript

import * as chai from 'chai';
import * as _ from 'lodash';
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([
'name',
'sourceCodes',
'sources',
'sourceMap',
'sourceMapRuntime',
'bytecode',
'runtimeBytecode',
]);
});
});
});
});