testing

alex 2022-10-26T21:33:46.404949Z

plexus 2022-10-28T14:45:21.731269Z

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

✅ 1
Phillip Mates 2023-02-07T14:13:10.531459Z

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: https://gist.github.com/philomates/32f8e1f7a2a4e746ac0186964aaaa2d3#file-flow-clj-L12 override the original, do custom logic, and then call the original to preserve existing behavior: https://gist.github.com/philomates/32f8e1f7a2a4e746ac0186964aaaa2d3#file-flow-clj-L32-L34

plexus 2022-10-27T14:54:27.095089Z

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

alex 2022-10-27T21:22:15.818749Z

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?