Product reviews

fast-check review for property-based JavaScript testing

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

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.

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 propertyFailure it can exposeWhat to inspect
Repeated item codesIncorrect mergingAt least two lines for the same item occur
Per-code quantity conservedA quantity credited to the wrong itemExpected totals calculated independently
Shrunk counterexampleSmallest case reached by shrinkingCan 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

Your next release starts here

Keep building.
Put testing to work.

Give Cue April your next testing challenge. Let your AI quality lead coordinate the checks, so your team can focus on what comes next.

Create account

Create your account, connect a repository and review your proposed setup before approving a run.