This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-11
Channels
- # announcements (2)
- # asami (1)
- # babashka (15)
- # beginners (29)
- # calva (6)
- # cider (22)
- # clara (1)
- # cljfx (1)
- # clojure (86)
- # clojure-australia (1)
- # clojure-dev (25)
- # clojure-europe (38)
- # clojure-france (7)
- # clojure-italy (3)
- # clojure-losangeles (1)
- # clojure-nl (6)
- # clojure-seattle (1)
- # clojure-spec (9)
- # clojure-uk (25)
- # clojuredesign-podcast (2)
- # clojurescript (4)
- # conjure (9)
- # cryogen (8)
- # cursive (17)
- # data-science (5)
- # datalog (1)
- # deps-new (1)
- # depstar (1)
- # emacs (1)
- # events (6)
- # fulcro (2)
- # graphql (3)
- # helix (4)
- # jackdaw (1)
- # jobs (1)
- # kaocha (9)
- # leiningen (4)
- # malli (1)
- # off-topic (7)
- # other-lisps (2)
- # pathom (12)
- # re-frame (16)
- # remote-jobs (1)
- # shadow-cljs (28)
- # spacemacs (19)
- # sql (2)
- # test200 (2)
- # testing (5)
- # timbre (1)
- # tools-deps (18)
- # xtdb (10)
Hey! Does anyone know a way to expect standard diff function of clojure.test/is
macro with lambdaisland.deep-diff2
in order to be able to do nice diffing and quickly see what is wrong?
Hey @U4N27TADS, we use https://github.com/weavejester/eftest at our projects. It provides a decent pretty diff. I’m not sure but by looking at its code, it looks like eftest
defines a custom https://github.com/weavejester/eftest/blob/master/eftest/src/eftest/runner.clj#L211 for clojure.test/report
. I’d recommend taking a look at it.
Hey thx for reply, I played around and extended report
function next way:
(defmethod report :fail [m]
(with-test-out
(inc-report-counter :fail)
(println "\nFAIL in" (testing-vars-str m))
(when (seq *testing-contexts*) (println (testing-contexts-str)))
(when-let [message (:message m)] (println message))
;(println "expected:" (pr-str (:expected m)))
;(println " actual:" (pr-str (:actual m)))
(let [[expected actual] (as-> m m
(m :actual)
(nth m 1)
(vec m)
(drop 1 m))]
(ddiff/pretty-print (ddiff/diff expected actual)))))
It solved my problem
cool!