@ -218,11 +218,12 @@ class App {
return new Promise ( ( resolve , reject ) => {
return new Promise ( ( resolve , reject ) => {
try {
try {
this . coverage . generate ( this . events , ` ${ this . workingDir } /contracts ` ) ;
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 ) ;
fs . writeFileSync ( './coverage.json' , json ) ;
collector . add ( this . coverage . c overage) ;
collector . add ( newC overage) ;
reporter . add ( 'html' ) ;
reporter . add ( 'html' ) ;
reporter . add ( 'lcov' ) ;
reporter . add ( 'lcov' ) ;
reporter . add ( 'text' ) ;
reporter . add ( 'text' ) ;
@ -240,6 +241,14 @@ class App {
// ------------------------------------------ Utils ----------------------------------------------
// ------------------------------------------ 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 )
* Allows config to turn logging off ( for CI )
* @ param { Boolean } isSilent
* @ param { Boolean } isSilent