Skip to main content

Function: ignoreEqualValues()

ignoreEqualValues(): Plugin<unknown>

Defined in: packages/fast-check/src/check/plugin/EqualValuesPlugins.ts:63

Never execute the predicate twice on the same value and replay the outcome of the first execution instead. Discarded runs still count as runs.

Close to skipEqualValues except we replay the output of the first passing, meaning the replay counts as a run.

WARNING: Detecting equal values is based on stringifying them. It may result in false positives and false negatives.

Returns

Plugin<unknown>

Example

fc.assert(
fc.property(..., (...) => {...}),
{ plugins: [fc.ignoreEqualValues()] }
)

Remarks

Since 4.10.0