Skip to content

Commit 3586eea

Browse files
TreyMichaels7tmichaels2025danadajian
authored
feat: set job to fail when visual diff found (#644)
Co-authored-by: tmichaels2025 <tmichaels2025@users.noreply.github.com> Co-authored-by: Dan Adajian <danadajian@gmail.com>
1 parent e49385b commit 3586eea

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

action/dist/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36095,6 +36095,7 @@ var run = async () => {
3609536095
...import_github6.context.repo
3609636096
});
3609736097
await createGithubComment();
36098+
(0, import_core6.setFailed)("A visual regression was detected. Check Comparadise!");
3609836099
};
3609936100

3610036101
// src/main.ts

action/dist/main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

action/src/run.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,6 @@ export const run = async () => {
163163
...context.repo
164164
});
165165
await createGithubComment();
166+
167+
setFailed('A visual regression was detected. Check Comparadise!');
166168
};

action/test/run.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ describe('main', () => {
194194
'path/to/another-screenshot/diff.png'
195195
]);
196196
await run();
197-
expect(setFailed).not.toHaveBeenCalled();
197+
expect(setFailed).toHaveBeenCalled();
198198
expect(exec).not.toHaveBeenCalledWith('rm path/to/screenshots/diff.png');
199199
expect(exec).toHaveBeenCalledWith('rm path/to/another-screenshot/diff.png');
200200
expect(octokit.rest.repos.createCommitStatus).toHaveBeenCalledWith({

0 commit comments

Comments
 (0)