Fork me on GitHub
#cider
<
2021-09-20
>
respatialized15:09:21

Can I configure CIDER to print the annotations generated by forms like (clojure.test/testing "xyz" ...) in the REPL?

vemv18:09:02

I have this in a helper ns somewhere

(defmacro testing [string & body]
  `(binding [clojure.test/*testing-contexts* (conj clojure.test/*testing-contexts* (doto (str (clojure.string/trim (str ~string)) "\n")
                                                                                     println))]
     ~@body))

(alter-var-root #'clojure.test/testing (constantly @#'testing))
(originally I created it for inserting a "\n". Sneaked a println to satisfy your requirement)

vemv18:09:23

It works well, make sure to reload any test namespaces

vemv18:09:21

...You can always create/use your own testing btw if you're fully in control of your codebase. I monkeypatch because I want to use it in places outside my control