@@ -41,7 +41,7 @@ class ResembleHelper extends Helper {
4141 absolutePathOfReportFolder = Container . mocha ( ) . options . reporterOptions . reportDir ;
4242 }
4343 // support mocha-multi-reporters
44- if ( Container . mocha ( ) && typeof Container . mocha ( ) . options . reporterOptions . mochawesomeReporterOptions . reportDir !== 'undefined' ) {
44+ if ( Container . mocha ( ) && typeof Container . mocha ( ) . options . reporterOptions . mochawesomeReporterOptions ? .reportDir !== 'undefined' ) {
4545 absolutePathOfReportFolder = Container . mocha ( ) . options . reporterOptions . mochawesomeReporterOptions . reportDir ;
4646 }
4747 return path . relative ( absolutePathOfReportFolder , absolutePathOfImage ) ;
@@ -191,11 +191,11 @@ class ResembleHelper extends Helper {
191191
192192 if ( mocha !== undefined && misMatch >= options . tolerance ) {
193193 await mocha . addMochawesomeContext ( "Base Image" ) ;
194- await mocha . addMochawesomeContext ( this . resolveImagePathRelativeFromReport ( this . _getBaseImagePath ( baseImage , options ) ) ) ;
194+ await mocha . addMochawesomeContext ( this . _resolveRelativePath ( this . _getBaseImagePath ( baseImage , options ) ) ) ;
195195 await mocha . addMochawesomeContext ( "ScreenShot Image" ) ;
196- await mocha . addMochawesomeContext ( this . resolveImagePathRelativeFromReport ( this . _getActualImagePath ( baseImage ) ) ) ;
196+ await mocha . addMochawesomeContext ( this . _resolveRelativePath ( this . _getActualImagePath ( baseImage ) ) ) ;
197197 await mocha . addMochawesomeContext ( "Diff Image" ) ;
198- await mocha . addMochawesomeContext ( this . resolveImagePathRelativeFromReport ( this . _getDiffImagePath ( baseImage ) ) ) ;
198+ await mocha . addMochawesomeContext ( this . _resolveRelativePath ( this . _getDiffImagePath ( baseImage ) ) ) ;
199199 }
200200 }
201201
@@ -344,8 +344,8 @@ class ResembleHelper extends Helper {
344344 options . boundingBox = await this . _getBoundingBox ( selector ) ;
345345 }
346346 const misMatch = await this . _fetchMisMatchPercentage ( baseImage , options ) ;
347- this . _addAttachment ( baseImage , misMatch , options ) ;
348- this . _addMochaContext ( baseImage , misMatch , options ) ;
347+ await this . _addAttachment ( baseImage , misMatch , options ) ;
348+ await this . _addMochaContext ( baseImage , misMatch , options ) ;
349349 if ( awsC !== undefined ) {
350350 await this . _upload ( awsC . accessKeyId , awsC . secretAccessKey , awsC . region , awsC . bucketName , baseImage , options )
351351 }
0 commit comments