# fast-check review for property-based testing

> Evaluate generated inputs and shrinking in fast-check. See how a failure against an independent business rule can become a small regression case.

Source: https://cueapril.com/reviews/fast-check
Updated: 2026-12-01
Index: https://cueapril.com/llms.txt

## When is fast-check worth adding beside example-based tests?

fast-check works well when a maintainer can state an invariant that should hold across many inputs. It generates examples and tries to shrink a failing input to a smaller counterexample. The quality of the result depends on both the rule and the inputs your generator allows.

See how generated inputs and shrinking can turn a failed business rule into a small regression case.

Cue April editorial assessment. The sources identify documented capabilities. Suggested pilot checks are evaluation criteria.

## Choose a property stronger than a round trip

Suppose a cart merges repeated item codes into one line per item. Total quantity should stay constant, but a buggy function could preserve the total while assigning the quantity to the wrong code. A stronger property compares totals for each code. Generate repeated codes often enough to explore the behaviour you bought the tool to test.

fast-check review for property-based JavaScript testing

| Generator or property | Failure it can expose | What to inspect |
| --- | --- | --- |
| Repeated item codes | Incorrect merging | At least two lines for the same item occur |
| Per-code quantity conserved | A quantity credited to the wrong item | Expected totals calculated independently |
| Shrunk counterexample | Smallest case reached by shrinking | Can a maintainer reproduce and explain it? |

## Keep the smallest useful failure

This desk review follows fast-check’s official getting-started example. During a pilot, deliberately reverse the merge rule for one item code. Record the failing seed and counterexample, then replay it and decide whether to add a named example beside the property. A compact case that a product owner can understand makes the failure easier to maintain.

## Primary documentation

- [fast-check getting started and shrinking](https://fast-check.dev/docs/introduction/getting-started/)

By Cue April. Updated 2026-12-01.

## Related

- [Product reviews](https://cueapril.com/reviews): Read documentation-based reviews of QA tools and coding agents. Find the workflow each product supports and a concrete way to test its fit.
- [Property-based testing](https://cueapril.com/testing/property-based-testing): Run a fast-check property-based testing example: find a delivery-rule boundary fault, replay its seed and counterexample, and verify the fix.
- [Unit testing](https://cueapril.com/testing/unit-testing): Unit testing explained, with examples. Run your Jest or Vitest suites against a pinned code revision and inspect the native results and remaining gaps.
