Merge pull request #899 from embark-framework/bugfix/filter-interface-contracts-from-coverage

Filter out interfaces from the coverage report
This commit is contained in:
Iuri Matias 2018-09-26 08:53:12 -04:00 committed by GitHub
commit c06f39d53e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -97,6 +97,11 @@ class ContractSource {
}
}
isInterface() {
return this.contractBytecode !== undefined &&
Object.values(this.contractBytecode).every((contractBytecode) => { return (Object.values(contractBytecode).length <= 1); });
}
/*eslint complexity: ["error", 38]*/
generateCodeCoverage(trace) {
if(!this.ast || !this.contractBytecode) throw new Error('Error generating coverage: solc output was not assigned');

View File

@ -60,6 +60,7 @@ class ContractSources {
var coverageReport = {};
for(var file in this.files) {
if(this.files[file].isInterface()) continue;
coverageReport[file] = this.files[file].generateCodeCoverage(trace);
}