Fork me on GitHub

unless someone figures out how to get a CLJS repl environment that is backed by the shadow-cljs compiler, Kaocha will not work with Shadow-cljs

Christian Johansen08:01:06

what's the right way to set *print-namespace-maps* to false for kaocha runs? using set! doesn't work

Christian Johansen09:01:00

I ended up creating my own testing macro that generates a call to clojure.test/testing that wraps the body in a binding. alter-var-root didn't seem to work either. if there's a better way, let me know


The wrap-run hook is meant for these kind of things, but it seems the hooks plugin doesn't yet support it, so you'd have to write your own plugin.


A generic plugin for configuring dynamic vars from tests.edn is on the roadmap


(defplugin my.ns/my-plugin
  (wrap-run [run test-plan]
    (fn [& args]
      (binding [...]
        (apply run args)))))

Christian Johansen11:01:53

I ended up with this for now:

Christian Johansen11:01:56

(defmacro defscenario [scenario body]
  `(clojure.test/deftest ~(symbol (clojure.string/replace scenario #" " "-"))
     (binding [*print-namespace-maps* false]