Skip to content

Commit 9312766

Browse files
committed
Suppress duplicate if/then validation errors for interaction steps
Extend the existing source-type error suppression pattern to also cover interaction step conditional requires, reducing noise when a click/hover/wait/scroll is missing its selector or eval is missing its script.
1 parent bf0ca2f commit 9312766

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/screenshots/scripts/validate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ function formatErrors(errors) {
2121
const missingProp = err.params.missingProperty;
2222
return `${err.instancePath}: source requires "${missingProp}" field`;
2323
}
24-
// if/then failures on source type — suppress the generic message, the required error above covers it
25-
if (err.keyword === 'if' && err.instancePath.match(/\/screenshots\/\d+\/source$/)) {
24+
// if/then failures — suppress the generic message, the required error above covers it
25+
if (err.keyword === 'if' && err.instancePath.match(/\/screenshots\/\d+\/(source|capture\/interaction\/\d+)$/)) {
2626
return null;
2727
}
2828
return `${err.instancePath || '/'}: ${err.message}`;

0 commit comments

Comments
 (0)