Skip to content

Generate a single value #4942

Answered by dubzzz
denizdogan asked this question in Q&A
Discussion options

You must be logged in to vote

At the moment it's the recommended way. There is no built-in function provided to generate 'random' values outside of a property.

To generate random values and drop the bias applied by fast-check you may want to add the .noBias() on your arbitraries. Bias being more frequent for the very first generated values the [0] might be highly impacted by it. More at https://fast-check.dev/docs/core-blocks/arbitraries/combiners/any/#nobias

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dubzzz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #4914 on April 28, 2024 09:34.