Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following the discussion started on #79. I'm opening this PR as an opened question and suggestion to better cover the library and its edge-cases.
Feel free to close it 👍
First, what is property-based testing? It's a technic coming from functional world and aiming to help devs into detecting edge cases without having them to think of them too much.
Why, property-based testing? Well, in order to reduce the risks of bugs and potentially regressions on key libraries.
Could it found problems? Well, probably. I tried another property but I'm not sure whether or not the failure is considered as ok or not. As such I'm not sure of what to expect from truncate so I was not able to make a decision.
Who am I? I'm the author of fast-check, the library added by this PR. It's the leading property-based testing library today.