 
     (finally
       (print ansi-reset))))
+
+; Summary reporting with color
+(defmethod report :summary [m]
+  (try
+    (print ansi-bold)
+    (when (not (every? zero? [(:fail m) (:error m)]))
+      (print ansi-red))
+
+    (with-test-out
+      (println "\nRan" (:test m) "tests containing"
+               (+ (:pass m) (:fail m) (:error m)) "assertions.")
+      (println (:fail m) "failures," (:error m) "errors.")
+
+      ; print names of failed tests
+      (print ansi-reset)
+      (print ansi-red)
+      (println (clojure.string/join "\n" (distinct @failed-tests)))
+
+      ; clear a list of failed tests (important if tests are automatically rerun)
+      (reset! failed-tests []))
+
+    (finally
+      (print ansi-reset))))

; Prettify test reports
(ns unit.reporter
  (:require
    [clojure.test :refer [report with-test-out inc-report-counter *testing-contexts* testing-contexts-str testing-vars-str *stack-trace-depth*]]
    [clojure.stacktrace :as stack]))

; Change the report multimethod to ignore namespaces that don't contain any tests.

      (print ansi-reset))))

(defmethod report :error [m]
  (add-failed-test!)

  (try
    (print ansi-red)
    (with-test-out
