@dharrigan we have no plans or intention to further support midje, the recommended migration path is via fudje. Midje is a very weird animal and there's just no way to do it well.
Yeah, it's not well liked at our place, so we are going to start moving across to expectations...
I'm sorry we can't provide a better experience for midje, but it also seems there are better places to put our energy, given that folks are generally moving away from it.
Have you tried fudje? It should be a drop-in replacement that's clojure.test compatible, I'd be curious to hear if that's not your experience.
Yeah, totally understand.
Yeah, couldn't get fudje to work either
I'll have another look to see why
in general, or with kaocha? we do care about working with fudje, but there should not be much (if anything) for us to do, since they are based on clojure.test
Let me get back to you
I'll have to reattempt it again
ok 🙂
For the figwheel folks, it would be helpful to share your config, especially cljs compiler config. Contrary to shadow figwheel uses the vanilla compiler, and so figwheel projects should be able to use kaocha-cljs, but there might be compiler flags that interfere with how kaocha-cljs works. kaocha-cljs2 should be usable in any scenario, it's completely agnostic to how you compile or which runtime env you use, but (I'm aware) it's a PITA to set up. We do plan to do something about that.
The other issue with kaocha-cljs is that it's a pain to debug, because we rely on the cljs prepl which gives very little indication of what the problem is when things go wrong, but for simple setups it's still pretty useful, because it's so much simpler internally compared to kaocha-cljs2.
Please also note that the right place to report things is in the github issues.
when I use lein test on some defspec like
(ns seed-repro-test
(:require
[clojure.test.check.clojure-test :refer [defspec]]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]))
(defspec zero-identity
100
(prop/for-all [i gen/small-integer]
(= 0 (* i 0))))
the generative seed and other info is exposed, like so:
[0] % lein test
lein test seed-repro-test
{:result true, :num-tests 100, :seed 1662567118509, :time-elapsed-ms 6, :test-var "zero-identity"}
Ran 1 tests containing 1 assertions.
0 failures, 0 errors.
when running kaocha, i don’t see this info exposed:
[0] % lein kaocha
--- unit (clojure.test) ---------------------------
seed-repro-test
zero-identity
1 tests, 1 assertions, 0 failures.
is this something I can enable via configuration?project.clj:
(defproject seed-repro "0.0.0"
:dependencies
[[org.clojure/clojure "1.11.1"]
[org.clojure/spec.alpha "0.2.194"]
[org.clojure/test.check "1.1.1"]
[lambdaisland/kaocha "1.68.1059"] ]
:aliases {"kaocha"
["run" "-m" "kaocha.runner"]})
tests.edn:
#kaocha/v1 {:reporter kaocha.report/documentation}
Hmm this vaguely rings a bell. Can you try with --reporter debug?
ah, i see a relevant message:
{:type :pass, :file "assertions.cljc", :line 34, :message {:pass? true, :num-tests 100, :time-elapsed-ms 7, :seed 1662571265810, :test-var "zero-identity"}, :kaocha/testable #:kaocha.testable{:id :seed-repro-test/zero-identity, :type :kaocha.type/var}}
{:type :end-test-var, :file "form-init1272814458836001206.clj", :line 1, :var #'seed-repro-test/zero-identity, :kaocha/testable #:kaocha.testable{:id :seed-repro-test/zero-identity, :type :kaocha.type/var}}
hm, so on failure I get the seed. ill dig in a bit more as to why my actual test suite isn’t showing it tomorrow
ah, the issue is when an exception is thrown (e.g. during such-that generation). but the vanilla test runner doesn’t show the seed there either. and i only really care about the seed on failures atm. so nothing to worry about. thanks for the help
ERROR in seed-repro-test/zero-identity (generators.cljc:435)
Uncaught exception, not in assertion.
Exception: clojure.lang.ExceptionInfo: Couldn't satisfy such-that predicate after 10 tries.
{:pred #object[seed_repro_test$zero_identity$fn__6210 0x1a06602f "seed_repro_test$zero_identity$fn__6210@1a06602f"], :gen #clojure.test.check.generators.Generator{:gen #object[clojure.test.check.generators$sized$fn__3061 0x5b6cc344 "clojure.test.check.generators$sized$fn__3061@5b6cc344"]}, :max-tries 10}