Question

Is there a version of quickcheck that works for Javascript and that is well maintained? I have found several such as check.js and claire, but none of them seem to support shrinking of failing test cases, which has always struck me as the most useful part of the whole problem.

Was it helpful?

Solution

I'm creator of jsverify. I'll try constantly to make it better, bug reports and feature requests are welcomed.

There are also a list of other javascript generative testing libraries in a readme. So far I haven't found any other good alternative to the jsverify.

OTHER TIPS

I recently released https://github.com/dubzzz/fast-check

I built it in order to answer several limitations I encountered in the existing quickcheck implementations in JavaScript.

It comes natively with a shrink feature which can shrink even combination of arbitraries (the frameworks I tried were failing on oneof like arbitraries). It also can generate large objects and arrays. By default it tends to try smaller values first in order to detect trivial edge cases while it covers all the possible inputs in next runs. Lots of other features are on-going or already available :)

Cheers, Nicolas

I wrote quick_check.js, which has a nice library of generators. Shrinking is not there yet, but is planned.

There seems to be a dearth of good quickcheck-like testing tools in javascript. However they are to be better supported in typed languages, and in fact you can write your tests in one of those languages if you wish.

To avoid dealing with runtime interop, I'd recommend going with a language which compiles to JS and runs on node.js (eg: Purescript with purescript-quickcheck), or a java-based language using the Nashorn engine provided in Java 8, for example ScalaCheck. You could even use ghcjs and the original flavor of the quickcheck library!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top