Fork me on GitHub
#testing
<
2017-04-14
>
witek10:04:11

Hi. I am using the boot with the test task from adzerk.boot-test. It prints Testing my.namespace.here for every namespace I have in my project. Even if that namespace does not contain any tests. This is no fun, since one has to scroll up every thime a test fails. How to disable this output?

seancorfield16:04:18

@witek That output comes from clojure.test itself.

seancorfield16:04:50

You may want to tell boot-test to only load a subset of your namespaces. For example, if all your tests are in something.test.whatever namespaces, you could provide -I test to I-nclude only namespaces with test in their name.

metametadata17:04:56

@witek you could also try redefining clojure.test/report method by adding this file into your test folder:

; Prettify test reports
(ns unit.reporter
  (:require
    [clojure.test :refer [report with-test-out]]))

; Change the report multimethod to ignore namespaces that don't contain any tests.
; taken from: 
(defmethod report :begin-test-ns [m]
  (with-test-out
    (when (some #(:test (meta %)) (vals (ns-interns (:ns m))))
      (println "\n-------====== Testing" (ns-name (:ns m)) "======-------"))))