ghostwheel

Hassle-free clojure.spec, automatic generative testing, side effect detection, and evaluation tracing for Clojure(-Script) – https://github.com/gnl/ghostwheel
gnl 2018-08-20T08:36:49.000100Z

@armikhalev Code looks fine at first sight, I don't really have time to look into it right now, I'll see if I can reproduce this tonight.

Sen 2018-08-20T12:42:35.000100Z

I've tried everything from scratch, new re-frame app with the same relevant code for Ghostwheel (without everything else I have though), it works! Well, I still have to restart figwheel to add metadata to a new namespace if I want specs in a different ns, but at least it is consistent behavior. Now I'm really confused about what is making Ghostwheel produce empty errors in my code. Maybe something overrides it?

gnl 2018-08-21T08:23:41.000100Z

@armikhalev So when you say it works, what /does/ work exactly? Are you getting the same empty messages like before for every single function with the namespace code and project.clj that you posted above?

Sen 2018-08-21T12:38:49.000100Z

What works is that error messages appear when I add

#:ghostwheel.core{:check     true
                    :num-tests 10}
to namespace and restart figwheel, if I don't restart it, then console doesn't show anything coming from ghostwheel. But those error messages still empty as in the image I posted, without any change to code.

Sen 2018-08-22T03:27:59.000100Z

I tried cljs.spec.test.alpha methods to see what happens using them in usual way:

(>defn ^::g/outstrument addition
       [a b]
       [pos-int? pos-int? => int? | #(> % a) #(> % b)]
       (+ a b))

(stest/instrument `addition)
(pp/pprint (stest/check `addition))
The result in the browser console:
[{:spec #object[cljs.spec.alpha.t_cljs$spec$alpha37737],
  :clojure.test.check/ret
  {:result true, :num-tests 1000, :seed 1534908067087},
  :sym mela-reframe-app.panels.koyla/addition}]
While (g/check) still gives me empty error. By the way, thanks for the help, really want to make it work, makes using spec much easier.

Sen 2018-08-22T03:32:38.000100Z

Should also mention, that when I change plus to minus - expecting error, the error message appears as per ReadMe. So the only issue is that it shouldn't raise empty error on the correct function.

Sen 2018-08-22T03:50:50.000100Z

Finally I found what was causing the bug - I had [org.clojure/test.check "0.9.0"] in my project.clj, that was messing up everything! I'm so happy I can use Ghostwheel now!

🕺 1
gnl 2018-08-22T08:34:21.000100Z

@armikhalev Oh great, I was starting to run out of ideas here 🙂 Can you open an issue on GitHub that this tripped it up? I want to look into it and maybe add a note to the docs.

Sen 2018-08-22T14:01:18.000100Z

Sure, I'll do, hope it helps someone

gnl 2018-08-22T17:30:19.000100Z

@armikhalev Thanks!