Skip to content

Commit b02cc3c

Browse files
build(playwright): only add incomplete if 1 or more exist
1 parent f7a806c commit b02cc3c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

playwright/support/helper.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,12 @@ export const checkAccessibility = async (
8787
);
8888
}
8989
} else {
90-
await testInfo.attach("accessibility-incomplete.json", {
91-
body: JSON.stringify(accessibilityScanResults.incomplete, null, 2),
92-
contentType: "application/json",
93-
});
90+
if (accessibilityScanResults.incomplete.length > 0) {
91+
await testInfo.attach("accessibility-incomplete.json", {
92+
body: JSON.stringify(accessibilityScanResults.incomplete, null, 2),
93+
contentType: "application/json",
94+
});
95+
}
9496

9597
if (accessibilityScanResults.violations.length > 0) {
9698
await testInfo.attach("accessibility-violations.json", {

0 commit comments

Comments
 (0)