Skip to content

Commit

Permalink
fixing an issue with dynamic image compare where path doesn't exists …
Browse files Browse the repository at this point in the history
…due to and old bug.
  • Loading branch information
snevesbarros committed Aug 26, 2022
1 parent d714440 commit 6320def
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/utils/image-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,13 @@ imageUtils.removeScreenshotDirectories = (buildsToDelete) => {
};

imageUtils.generateDynamicBaseline = async (screenshot, screenshots) => {
// ensure path exists due to an old bug
const buildPath = `screenshots/${screenshot.build}`;
if (!fs.existsSync(buildPath)) {
fs.mkdirSync(buildPath);
}
// file name we'll be overriding it a few times.
const fileName = `screenshots/${screenshot.build}/${screenshot.id}-${Date.now()}-dynamic-baseline.png`;
const fileName = `${buildPath}/${screenshot.id}-${Date.now()}-dynamic-baseline.png`;
const currentScreenshotObject = screenshot.toObject();
delete currentScreenshotObject._id;
const currentScreenshot = new Screenshot(currentScreenshotObject);
Expand Down

0 comments on commit 6320def

Please sign in to comment.