Primitives
Primitive arbitraries are the only arbitraries in fast-check that do not depend on another one. Everything else — composites, combiners, fake data — is eventually wired back to a primitive, which makes the rules on this page the foundation of how the whole library behaves.
Two things are worth knowing before you open any child page:
- Constraints stay local. Each primitive exposes its own constraints (ranges for numbers, allowed characters for strings, bounds for dates…). When a more complex arbitrary is built on top, it inherits whatever constraints you put here — so the narrower you make a primitive, the narrower every downstream value becomes.
- Shrinking converges to canonical "simple" values. When a test fails, fast-check shrinks each primitive toward a well-known minimum:
0for numbers,''for strings,falsefor booleans, the Unix epoch for dates,0nfor bigints. Every counterexample you read in the terminal is the product of that convergence, so it pays to recognise these anchors on sight.
BigInt
Generate bigint values.
Boolean
Generate boolean values.
Date
Generate date values.
Number
Generate numeric values.
String
Generate string values.