kaocha

dharrigan 2022-02-09T15:59:33.386659Z

Is there a way for kaocha to load a src namespace first, before any other namespace? I'm started to look at a project that uses lein + midje and for reasons, a particular namespace has to be loaded first. Trying to replicate this usings deps and kaocha, with no success so far.

🤔 1
oxalorg (Mitesh) 2022-02-10T14:17:17.944529Z

Have you tried the preload plugin? https://cljdoc.org/d/lambdaisland/kaocha/1.0.861/api/kaocha.plugin.preloads

oxalorg (Mitesh) 2022-02-10T14:17:27.663099Z

#kaocha/v1
{:plugins [:preloads]
 :kaocha.plugin.preloads/ns-names [my.acme.specs]}

dharrigan 2022-02-10T17:25:04.234699Z

kewl

dharrigan 2022-02-10T17:25:16.208069Z

will try that!

1
dharrigan 2022-02-10T17:25:19.413729Z

ta!

2022-02-09T19:25:50.531699Z

is there a good reference for better diffing and error reporting? I've got a custom equality check on very large, complex values. I'd love to give a fancy deep diff of it (especially since it's probably really close to correct)

oxalorg (Mitesh) 2022-02-10T14:23:07.614029Z

Kaocha already uses deep-diff2 library for diffing. But if you want to override it for specific equality checks I think it can be done using something like

(defmethod kaocha.report/print-expr custom= [{:keys [expected actual]}]
  (println expected actual)))
Then when you do
(is (custom= ...))
This will run

oxalorg (Mitesh) 2022-02-10T14:23:24.196889Z

I am not super sure as this is mostly for the summary, not sure if this helps you!