Skip to content

feat: change attempt separator to _ #199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: update tests
Signed-off-by: Jakub Freisler <jakub@frsource.org>
  • Loading branch information
FRSgit committed Dec 4, 2022
commit 5c7d81e331d58e3bc9d3a09a233f137245b93cc9
23 changes: 14 additions & 9 deletions src/task.hook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ describe("getScreenshotPathInfoTask", () => {
titleFromOptions: "some-title-withśpęćiał人物",
imagesPath: "nested/images/dir",
specPath,
currentRetryNumber: 0,
})
).toEqual({
screenshotPath:
"__cp-visual-regression-diff_snapshots__/nested/images/dir/some-title-withśpęćiał人物 #0.actual.png",
title: "some-title-withśpęćiał人物 #0.actual",
"__cp-visual-regression-diff_snapshots__/nested/images/dir/some-title-withśpęćiał人物_#0.actual.png",
title: "some-title-withśpęćiał人物_#0.actual",
});
});

Expand All @@ -62,11 +63,12 @@ describe("getScreenshotPathInfoTask", () => {
titleFromOptions: "some-title",
imagesPath: "{spec_path}/images/dir",
specPath,
currentRetryNumber: 0,
})
).toEqual({
screenshotPath:
"__cp-visual-regression-diff_snapshots__/some/nested/spec-path/images/dir/some-title #0.actual.png",
title: "some-title #0.actual",
"__cp-visual-regression-diff_snapshots__/some/nested/spec-path/images/dir/some-title_#0.actual.png",
title: "some-title_#0.actual",
});
});

Expand All @@ -76,23 +78,25 @@ describe("getScreenshotPathInfoTask", () => {
titleFromOptions: "some-title",
imagesPath: "/images/dir",
specPath,
currentRetryNumber: 0,
})
).toEqual({
screenshotPath:
"__cp-visual-regression-diff_snapshots__/{unix_system_root_path}/images/dir/some-title #0.actual.png",
title: "some-title #0.actual",
"__cp-visual-regression-diff_snapshots__/{unix_system_root_path}/images/dir/some-title_#0.actual.png",
title: "some-title_#0.actual",
});

expect(
getScreenshotPathInfoTask({
titleFromOptions: "some-title",
imagesPath: "C:/images/dir",
specPath,
currentRetryNumber: 0,
})
).toEqual({
screenshotPath:
"__cp-visual-regression-diff_snapshots__/{win_system_root_path}/C/images/dir/some-title #0.actual.png",
title: "some-title #0.actual",
"__cp-visual-regression-diff_snapshots__/{win_system_root_path}/C/images/dir/some-title_#0.actual.png",
title: "some-title_#0.actual",
});
});
});
Expand All @@ -104,6 +108,7 @@ describe("cleanupImagesTask", () => {
titleFromOptions: "some-file",
imagesPath: "images",
specPath: "some/spec/path",
currentRetryNumber: 0,
});
return path.join(
projectRoot,
Expand Down Expand Up @@ -131,7 +136,7 @@ describe("cleanupImagesTask", () => {
it("removes unused screenshot", async () => {
const { path: projectRoot } = await dir();
const screenshotPath = await writeTmpFixture(
path.join(projectRoot, "some-file-2 #0.png"),
path.join(projectRoot, "some-file-2_#0.png"),
oldImgFixture
);

Expand Down