fast-check icon indicating copy to clipboard operation
fast-check copied to clipboard

✨ Add ability to limit shrink path

Open dubzzz opened this issue 1 month ago • 3 comments

Description

We want to offer a way for our users to limit the depth and overall size of the shrinking capabilities. At the moment, they can only either apply shrink or drop it totally. We want to offer a finer way to control the shrinks.

This proposal is related to #4162.

At the moment, we added an extra method for all our arbitrary but I feel that it will not be scalable. I believe we should go for yet another utility arbitrary that will be responsible to offer such capabilities. Regarding offering these capabilities at assert level itself, we should probably (option 1) do as we used to do for timeouts..., or (option 2) start thinking into some kind of plugin system. Option 1 seems to be a valid option for version 3 of fast-check, we could also start offering a noShrink utility either hidden behind limitShrink one (probably better) or directly.

NOTE: Not ready yet, we should move from methods to a dedicated utility.

ChecklistDon't delete this checklist and make sure you do the following before opening the PR

  • [x] The name of my PR follows gitmoji specification
  • [x] My PR references one of several related issues (if any)
    • [x] New features or breaking changes must come with an associated Issue or Discussion
    • [x] My PR does not add any new dependency without an associated Issue or Discussion
  • [x] My PR includes bumps details, please run yarn bump and flag the impacts properly
  • [ ] My PR adds relevant tests and they would have failed without my PR (when applicable)

Advanced

  • [x] Category: ✨ Introduce new features
  • [x] Impacts: New arbitrary

dubzzz avatar May 21 '24 07:05 dubzzz