Clojurians
#kaocha
<
2019-01-24
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

plexus02:01:34

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

christian76708:01:06

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

christian76709: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

plexus09:01:11

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.

plexus09:01:27

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

plexus09:01:37

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

christian76711:01:53

I ended up with this for now:

christian76711:01:56

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