UNPKG

fast-check

Version:

Property based testing framework for JavaScript (like QuickCheck)

9 lines (8 loc) 340 B
import { Arbitrary } from './Arbitrary.js'; import { Shrinkable } from './Shrinkable.js'; class ArbitraryWithShrink extends Arbitrary { shrinkableFor(value, shrunkOnce) { return new Shrinkable(value, () => this.shrink(value, shrunkOnce === true).map((v) => this.shrinkableFor(v, true))); } } export { ArbitraryWithShrink };