@@ -41,7 +41,7 @@ class ResembleHelper extends Helper {
41
41
absolutePathOfReportFolder = Container . mocha ( ) . options . reporterOptions . reportDir ;
42
42
}
43
43
// 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' ) {
45
45
absolutePathOfReportFolder = Container . mocha ( ) . options . reporterOptions . mochawesomeReporterOptions . reportDir ;
46
46
}
47
47
return path . relative ( absolutePathOfReportFolder , absolutePathOfImage ) ;
@@ -191,11 +191,11 @@ class ResembleHelper extends Helper {
191
191
192
192
if ( mocha !== undefined && misMatch >= options . tolerance ) {
193
193
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 ) ) ) ;
195
195
await mocha . addMochawesomeContext ( "ScreenShot Image" ) ;
196
- await mocha . addMochawesomeContext ( this . resolveImagePathRelativeFromReport ( this . _getActualImagePath ( baseImage ) ) ) ;
196
+ await mocha . addMochawesomeContext ( this . _resolveRelativePath ( this . _getActualImagePath ( baseImage ) ) ) ;
197
197
await mocha . addMochawesomeContext ( "Diff Image" ) ;
198
- await mocha . addMochawesomeContext ( this . resolveImagePathRelativeFromReport ( this . _getDiffImagePath ( baseImage ) ) ) ;
198
+ await mocha . addMochawesomeContext ( this . _resolveRelativePath ( this . _getDiffImagePath ( baseImage ) ) ) ;
199
199
}
200
200
}
201
201
@@ -344,8 +344,8 @@ class ResembleHelper extends Helper {
344
344
options . boundingBox = await this . _getBoundingBox ( selector ) ;
345
345
}
346
346
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 ) ;
349
349
if ( awsC !== undefined ) {
350
350
await this . _upload ( awsC . accessKeyId , awsC . secretAccessKey , awsC . region , awsC . bucketName , baseImage , options )
351
351
}
0 commit comments