|
|
@ -57,6 +57,8 @@ class App { |
|
|
|
this.log('Generating coverage environment'); |
|
|
|
this.log('Generating coverage environment'); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
this.sanityCheckContext(); |
|
|
|
|
|
|
|
|
|
|
|
let files = shell.ls(this.workingDir); |
|
|
|
let files = shell.ls(this.workingDir); |
|
|
|
const nmIndex = files.indexOf('node_modules'); |
|
|
|
const nmIndex = files.indexOf('node_modules'); |
|
|
|
|
|
|
|
|
|
|
@ -188,7 +190,7 @@ class App { |
|
|
|
` |
|
|
|
` |
|
|
|
There was an error generating coverage. Possible reasons include: |
|
|
|
There was an error generating coverage. Possible reasons include: |
|
|
|
1. Another application is using port ${this.port} |
|
|
|
1. Another application is using port ${this.port} |
|
|
|
2. Truffle crashed because your tests errored |
|
|
|
2. Your test runner (Truffle?) crashed because the tests encountered an error. |
|
|
|
|
|
|
|
|
|
|
|
`;
|
|
|
|
`;
|
|
|
|
this.cleanUp(msg + err); |
|
|
|
this.cleanUp(msg + err); |
|
|
@ -240,6 +242,16 @@ class App { |
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------ Utils ----------------------------------------------
|
|
|
|
// ------------------------------------------ Utils ----------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sanityCheckContext(){ |
|
|
|
|
|
|
|
if (!shell.test('-e', `${this.workingDir}/contracts`)){ |
|
|
|
|
|
|
|
this.cleanUp("Couldn't find a 'contracts' folder to instrument."); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (shell.test('-e', `${this.workingDir}/${this.coverageDir}`)){ |
|
|
|
|
|
|
|
shell.rm('-Rf', this.coverageDir); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Relativizes path keys so that istanbul report can be read on Windows |
|
|
|
* Relativizes path keys so that istanbul report can be read on Windows |
|
|
|
* @param {Object} map coverage map generated by coverageMap |
|
|
|
* @param {Object} map coverage map generated by coverageMap |
|
|
|