@danielgrosse Yup, ::g/check
will be a bit better documented soon to make it clear that it just generates the per-function code for gen-testing and side effect detection, while (g/check)
runs it + does the coverage checks and potentially post-check callbacks.
@danielgrosse The tests are regular Clojure deftest
tests, so you can run them any way you like. However at the moment Ghostwheel's fancy custom reporter only works in the browser, so if you run them somewhere else the error messages may not be quite as nice. Fixing that is on the roadmap.
@danielgrosse You may also be interested in this: https://github.com/gnl/ghostwheel#performance-considerations-or-how-much-generative-testing-is-enough
Thank you for the answer. Unfortunately the anchor of the link is not existing.
Huh, yeah, for some reason the anchor only seems to work if the page is already open.
Are the tests only runnable in the browser, or can I also run them in the terminal? Like Clojure test
So I added two functions from the docs:
(>defn foo
[coll n]
[(spec/coll-of int? :kind vector?) int?
=> seq?]
(map n coll))
(>defn addition
[a b]
[pos-int? pos-int? => int? | #(> % a) #(> % b)]
(+ a b))
Both should pass, but they fail with empty error message:Is there something I'm missing?
Also, it might be related, when I want to run ghostwheel in another namespace by adding everything needed such as
(::g/check true)
(::g/num-tests 5)
;; my tests
(g/check)
somehow it is not detected by browser console, and nothing happens, though figwheel reloads page and raises errors if any.I tried running it both in Spacemacs with cider and running figwheel from terminal, no difference, if that matters
I tried (clean-builds)
with no success
I'm using ghostwheel in app based on https://github.com/Day8/re-frame-template