Skip to content
Snippets Groups Projects
Commit c8cde4ec authored by Alvaro Cabrera Durán's avatar Alvaro Cabrera Durán
Browse files

Generate enough props from min to all-props; fix

parent 66762d2d
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,7 @@ function objectType(value, path, resolve, traverseCallback) { ...@@ -50,7 +50,7 @@ function objectType(value, path, resolve, traverseCallback) {
const fixedProbabilities = optionAPI('alwaysFakeOptionals') || optionAPI('fixedProbabilities') || false; const fixedProbabilities = optionAPI('alwaysFakeOptionals') || optionAPI('fixedProbabilities') || false;
const ignoreProperties = optionAPI('ignoreProperties') || []; const ignoreProperties = optionAPI('ignoreProperties') || [];
const min = Math.max(value.minProperties || 0, requiredProperties.length); const min = Math.max(value.minProperties || 0, random.number(requiredProperties.length, allProperties.length));
const max = value.maxProperties || (allProperties.length + (allowsAdditional ? random.number(1, 5) : 0)); const max = value.maxProperties || (allProperties.length + (allowsAdditional ? random.number(1, 5) : 0));
let neededExtras = Math.max(0, min - requiredProperties.length); let neededExtras = Math.max(0, min - requiredProperties.length);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment