Skip to content

Commit

Permalink
fix: save actual image even when errImg is not available (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowusr authored Sep 14, 2023
1 parent 1096261 commit 68d6d21
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/image-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {
ImageInfo, ImageInfoError,
ImageInfoFail,
ImageInfoFull,
ImagesSaver
ImagesSaver,
ImageSize
} from './types';
import {ERROR, FAIL, PluginEvents, SUCCESS, TestStatus, UPDATED} from './constants';
import {getError, getShortMD5, isImageDiffError, isNoRefImageError, logger, mkTestId} from './common-utils';
Expand Down Expand Up @@ -97,11 +98,11 @@ export class ImageHandler extends EventEmitter2 implements ImagesInfoFormatter {
};
}

if (assertViewStatus === ERROR && errImg) {
if (assertViewStatus === ERROR) {
return {
actualImg: {
path: testResult.state?.name ? this._getImgFromStorage(currPath) : '',
size: currImg?.size || errImg.size
size: (currImg?.size || errImg?.size) as ImageSize
}
};
}
Expand Down

0 comments on commit 68d6d21

Please sign in to comment.