docs
docs copied to clipboard
Migrate "Random testing in JS" snippet
That page mentions QuickCheck. Note that https://github.com/dubzzz/fast-check is available now. The output is not great by default, but it can be customized if I remember correctly.
We can also consider packaging commonly used snippets too.
testing fast-check: https://www.codewars.com/kumite/5fed081200e85f001da9bbe1?sel=5fed081200e85f001da9bbe1 Also there's a fork with a nasty workaround. Not sure how to customize that output.
I haven't tried, but from their docs: https://github.com/dubzzz/fast-check/blob/master/documentation/Tips.md#customize-the-reported-error
Alright, cool: https://www.codewars.com/kumite/5fed4c3ea267f800094c3d68/?sel=5fed4c3ea267f800094c3d68
The problem now is, this Test Passed it puts because I didn't throw an error... Throwing an error would make ugly output again, so idk...
Also, the reporter would be something we'd want to include in a package somewhere, so you can do like const { reporter } = require('@codewars/utilities'); or whatever.
You can throw AssertionError and the reporter will know it was test failure and not some unexpected error. I forked your example.