Skip to main content

Function: constantFrom()

Call Signature

constantFrom<T>(...values): Arbitrary<T>

Defined in: packages/fast-check/src/arbitrary/constantFrom.ts:19

For one ...values values - all equiprobable

WARNING: It expects at least one value, otherwise it should throw

Type Parameters

Type ParameterDefault type
Tnever

Parameters

ParameterTypeDescription
...valuesT[]Constant values to be produced (all values shrink to the first one)

Returns

Arbitrary<T>

Remarks

Since 0.0.12

Call Signature

constantFrom<TArgs>(...values): Arbitrary<TArgs[number]>

Defined in: packages/fast-check/src/arbitrary/constantFrom.ts:31

For one ...values values - all equiprobable

WARNING: It expects at least one value, otherwise it should throw

Type Parameters

Type Parameter
TArgs extends any[] | [any]

Parameters

ParameterTypeDescription
...valuesTArgsConstant values to be produced (all values shrink to the first one)

Returns

Arbitrary<TArgs[number]>

Remarks

Since 0.0.12