Fork me on GitHub

In clojure.test you can rebind the reporter to a regular function or a multimethod. If you rebind to a regular function you do have to make sure you do it after any code that assumes it's a multimethod. If you use kaocha you can supply multiple reporters, so you can have one that simply checks for (= (:type m) :fail) and does nothing for other events


Thanks for the tip! Unfortunately not using Kaocha, but having multiple reporters support out of the box sounds great. Might have to explore Kaocha more 🙂 Would you rebind the reporter via binding or something else?


it's not a dynamic var, so you'd have to use with-redefs

Phillip Mates14:02:10

you can also do some hackery to re-define the clojure.test/report multimethod and still call to the original implementation as well capture the old impl: override the original, do custom logic, and then call the original to preserve existing behavior: