Function: sample()
sample<
Ts>(generator,params?):Ts[]
Defined in: packages/fast-check/src/check/runner/Sampler.ts:62
Generate an array containing all the values that would have been generated during assert or check
Type Parameters
| Type Parameter |
|---|
Ts |
Parameters
| Parameter | Type | Description |
|---|---|---|
generator | IRawProperty<Ts, boolean> | Arbitrary<Ts> | IProperty or Arbitrary to extract the values from |
params? | number | Parameters<Ts> | Integer representing the number of values to generate or Parameters as in assert |
Returns
Ts[]
Example
fc.sample(fc.nat(), 10); // extract 10 values from fc.nat() Arbitrary
fc.sample(fc.nat(), {seed: 42}); // extract values from fc.nat() as if we were running fc.assert with seed=42
Remarks
Since 0.0.6