testing

Testing tools, testing philosophy & methodology...
witek 2017-04-14T10:36:11.389135Z

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?

seancorfield 2017-04-14T16:39:18.530669Z

@witek That output comes from clojure.test itself.

seancorfield 2017-04-14T16:40:50.558682Z

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.

metametadata 2017-04-14T17:56:56.978214Z

@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: <http://blog.jayfields.com/2010/08/clojuretest-introduction.html>
(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)) "======-------"))))