   cljs.test
   (:require-macros
    [clojure.template :as temp]))
-
-;; =============================================================================
-;; Protocols
-
-(defprotocol ITestReporter
-  (-do-report [_ env m]))
 
 ;; =============================================================================
 ;; Default Reporting

  (print "  actual: ") (prn (:actual m))
  (inc-report-counter env :error))

(defmethod report :summary [env m]
  (println "\nRan" (:test m) "tests containing"
    (+ (:pass m) (:fail m) (:error m)) "assertions.")
  (println (:fail m) "failures," (:error m) "errors.")
  env)

(defmethod report :begin-test-ns [env m]
  (println "\nTesting" (name (:ns m)))
  env)

;; Ignore these message types:
(defmethod report :end-test-ns [env m] env)
(defmethod report :begin-test-var [env m] env)
(defmethod report :end-test-var [env m] env)

(deftype DefaultReporter []
  ITestReporter
  (-do-report [_ env m]
    (report env m)))

(defn default-reporter []
  (DefaultReporter.))

(defn file-and-line
  [exception depth]

            :fail (merge (file-and-line (js/Error.) 1) m)
            :error (merge (file-and-line (:actual m) 0) m)
            m)]
   (report env m)))

(defn empty-env
  ([] (empty-env ::default))
  ([reporter]
   {:report-counters {:test 0 :pass 0 :fail 0 :error 0}
    :testing-vars ()
