Skip to content

Commit 59c5869

Browse files
committed
Attempting to fix Validator tests
1 parent b84f086 commit 59c5869

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/Validator.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,6 @@ class Validator {
324324
) {
325325
return 'Value does not match pattern';
326326
}
327-
328-
// Here slotType value tested and is ok!
329-
continue;
330327
}
331328

332329
// Here value didn't parse to slotType
@@ -343,6 +340,11 @@ class Validator {
343340
const results = anyOfValidators.map((fn) => fn(value));
344341
const valid = results.some((result) => result === undefined);
345342
if (!valid) {
343+
// If every condition gives format error, just return one error
344+
// TODO does this apply in allOf, second branch of exactlyOneOf?
345+
if (results.every((result) => result === parse_error)) {
346+
return parse_error;
347+
}
346348
return results.join('\n');
347349
}
348350
}

0 commit comments

Comments
 (0)