@ -218,11 +218,12 @@ class App {
return new Promise ( ( resolve , reject ) => {
try {
this . coverage . generate ( this . events , ` ${ this . workingDir } /contracts ` ) ;
const newCoverage = App . makeKeysRelative ( this . coverage . coverage , this . workingDir ) ;
const json = JSON . stringify ( this . coverage . c overage) ;
const json = JSON . stringify ( newC overage) ;
fs . writeFileSync ( './coverage.json' , json ) ;
collector . add ( this . coverage . c overage) ;
collector . add ( newC overage) ;
reporter . add ( 'html' ) ;
reporter . add ( 'lcov' ) ;
reporter . add ( 'text' ) ;
@ -240,6 +241,14 @@ class App {
// ------------------------------------------ Utils ----------------------------------------------
static makeKeysRelative ( map , root ) {
const newCoverage = { } ;
Object . keys ( map ) . forEach ( pathKey => {
newCoverage [ path . relative ( root , pathKey ) ] = map [ pathKey ] ;
} ) ;
return newCoverage ;
}
/ * *
* Allows config to turn logging off ( for CI )
* @ param { Boolean } isSilent