-
Hey, I'm writing a fast check to assert invariants of a graphql queries that implement the relay pagination spec. In so doing, I create an infinite stream of integers that will be the sizes of the pages I select as I walk the paginated collection. The max size of the generator is specified as the max allowed page size, which is good, I would like to sometimes sample that part of the domain, but the test corpus is often much smaller, which results in a single page request much of the time. I think I'd like to bias my numbers towards smaller values, which has been the default behavior of other quick checkers I've used, but that doesn't seem to be the case for
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey, Actually today the combination of But the problem is that there is, at the moment, no bias all the values of this stream. In other words, in the current version of fast-check, while values produced by the generators of natural number can be biased from time to time, they are:
In the current versions the trick I'd suggest is to do something like:
|
Beta Was this translation helpful? Give feedback.
Hey,
Actually today the combination of
fc.infiniteStream
andfc.nat
can be considered as biased as it generates much more small numbers than what it should if the values was taken fully randomly:But the problem is that there is, at the moment, no bias all the values of this stream. In other words, in the current version of fast-check, while values produced by the generators of natural number can be biased from time to time, they are:
In the current versions the trick I'd suggest is to do something like: