T.array
A collection: one shape, repeated a random number of times.
T.array(T.string.whereby({ length: { max: 15 } })).whereby({
length: { min: 0, max: 10 },
});Every element comes from the same schema. The length is drawn from length.min to length.max, including both ends. The draw is uniform unless you add a distribution, which works the same as for T.number.integer (see Distributions).
length.min defaults to 0, so without a minimum, an empty array is a normal result. Either end can be exclusive: { min: { value: 0, exclusive: true }, max: 10 } is never empty. A plain length: N always gives exactly N elements. See Batches.
.admits({ length }) changes what adapters accept without changing what is generated, such as no maximum where test data only needs a few elements. See .admits(...).
For elements that never repeat within one array, see T.unique.array. For a fixed number of independently typed slots, see T.tuple. For drawn keys instead of indices, see T.record.
