Just using fast-check by itself can make you tests verbose and tough to read. Lucky for us there are many integrations with fast-check such as the @fast-check/jest
package that will help remove some boilerplate from our test.
Transcript
[00:00] You might be thinking to yourself that the test that we have here is quite verbose, quite indented, not very nice to look at. And I think you'd be right. Fortunately for us, there are various FastCheck libraries that integrate nicer with different testing libraries. For example, we can use the fastcheck-slash-gest library to clean this up. We start by replacing the existing fastcheck import with an import from fastcheck-slash-gest.
[00:34] And then we can replace what we had previously with this new test.prop, which folds in the previous fc.assert and fc.property calls that we were making and reduces the size and indentation of our tests. We can run it to make sure it works, and it does.