File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,7 @@ function arbitraryMapping() {
244244 // …then for each rule, generate a "node template" where:
245245 // - the keys are a single letter
246246 // - the values are either a number or a string.
247+ // - a function that return an array of each child's `ctorName`.
247248 // If a number, it's constrained to be less than the rule arity, because
248249 // the meaning is "put child[i] in this prop".
249250 const arities = new Map (
@@ -256,7 +257,11 @@ function arbitraryMapping() {
256257 ruleName ,
257258 fc . dictionary (
258259 fc . constantFrom ( ...'abcdefghijklmnopqrstuvwxyz' ) ,
259- fc . oneof ( fc . nat ( { max : arity - 1 } ) , fc . string ( ) ) ,
260+ fc . oneof (
261+ fc . nat ( { max : arity - 1 } ) ,
262+ fc . string ( ) ,
263+ fc . constant ( children => children . map ( c => c . ctorName ) ) ,
264+ ) ,
260265 ) ,
261266 ] ;
262267 } ) ,
You can’t perform that action at this time.
0 commit comments