I've got some specs in my code that use with-gen but now I can't lein uberjar the project because test.check is only specified for the dev profile in lein, not the uberjar one. What's the best way round this?
@peterhull90 spec is setup to not require this at runtime
unless you are using instrument or something at runtime in your uberjar execution
https://clojure.org/guides/spec#_project_setup describes it
you use (require '[clojure.spec.gen.alpha :as gen])
and s/with-gen
you give the generator as a no arg fn
so it’s all shielded behind the clojure.spec.gen.alpha
layer
which will only lazy load/require org.clojure/test.check
ns’s
@mikerod oho I am using instrument but I forgot about that. It was only for testing so I don't need it. Thanks a lot!
@peterhull90 nice. yeah that makes sense. just have to be careful where you use that sort of thing - keep it in dev-only ns’s/tests/etc