expound

erhlee-bird 2022-02-17T14:55:06.892899Z

hey all, I typically run my test suite via lein test and use a pretty vanilla clojure.test setup is there a way to easily integrate expound?

(ns foo.core-test
  (:require [clojure.spec.alpha :as spec]
            [clojure.test :as test :refer :all]
            [expound.alpha :as expound]
            [orchestra.spec.test :as spectest]))

(spec/check-asserts true)
(spectest/instrument)
(set! spec/*explain-out* expound/printer)

(deftest foo-test
  ...)
I've attempted something like the above but I'm still seeing default spec error reports

bbrinck 2022-04-10T20:18:52.139019Z

You need to register some specific report to handle errors of type :error. Here’s how clojure.test handles errors https://github.com/clojure/clojure/blob/35bd89f05f8dc4aec47001ca10fe9163abc02ea6/src/clj/clojure/test.clj#L717-L720

bbrinck 2022-04-10T20:22:05.074529Z

Here’s some code to get you started https://github.com/bhb/expound#manual-clojuretestreport-override