mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 14:24:24 +00:00
fix: make coverage more forgiving
This commit is contained in:
parent
6b16f668e0
commit
0f4e554b22
@ -32,13 +32,17 @@ export class ContractEnhanced {
|
||||
|
||||
constructor(public filepath: string, public solcVersion: string) {
|
||||
this.id = nextId();
|
||||
|
||||
// silence compiler warnings.
|
||||
this.source = this.originalSource = "";
|
||||
|
||||
try {
|
||||
this.source = fs.readFileSync(filepath, "utf-8");
|
||||
this.originalSource = this.source;
|
||||
this.ast = parser.parse(this.source, {loc: true, range: true});
|
||||
} catch (error) {
|
||||
this.source = "";
|
||||
this.originalSource = "";
|
||||
const {line, column, message} = error.errors[0];
|
||||
console.warn(`Error on ${this.filepath}:${line}:${column}: "${message}". Could not setup for coverage.`);
|
||||
}
|
||||
|
||||
this.coverageFilepath = path.join(coverageContractsPath(), this.filepath);
|
||||
|
Loading…
x
Reference in New Issue
Block a user