Fork me on GitHub

Hello everyone. I want to write some tests for my library but I really don’t want to write example based tests. I thought spec can be an instrument for property based testing, but couldn’t find a way to transform spec (or generator) into a test. Can someone please help me with that?

Alex Miller (Clojure team)12:07:41

With spec, the main way you do it is by writing function specs and running “check”

Alex Miller (Clojure team)12:07:17

Spec generators are also test.check generators so you can use test check property testing too


Oh this should work. Thank you very much

Alex Miller (Clojure team)18:07:14

in fact, I find using (s/gen a-spec) to often be easier than using test.check to create generators directly


@jahvenni is one attempt at this. I'm not sure if it's actively being worked on.