Fork me on GitHub
#expound
<
2022-02-17
>
erhlee-bird14:02:06

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

bbrinck20:04:52

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