   cljs.test
   (:require-macros [clojure.template :as temp]
                    [cljs.test :as test])
-  (:require [clojure.string :as string]))
+  (:require [clojure.string :as string]
+            [cljs.pprint :as pprint]))
 
 ;; =============================================================================
 ;; Default Reporting
 
 (defn empty-env
+  "Generates a testing environment with a reporter.
+   (empty-env) - uses the :cljs.test/default reporter.
+   (empty-env :cljs.test/pprint) - pretty prints all data structures. 
+   (empty-env reporter) - uses a reporter of your choosing.
+
+   To create your own reporter see cljs.test/report"
   ([] (empty-env ::default))
   ([reporter]
-   {:report-counters {:test 0 :pass 0 :fail 0 :error 0}
-    :testing-vars ()
-    :testing-contexts ()
-    :reporter reporter}))
+   (cond-> {:report-counters {:test 0 :pass 0 :fail 0 :error 0}
+            :testing-vars ()
+            :testing-contexts ()
+            :formatter pr-str
+            :reporter reporter}
+     (= ::pprint reporter) (assoc :reporter ::default
+                             :formatter pprint/pprint))))
 
 (def ^:dynamic *current-env* nil)
 

  #_(println ":begin-test-var" (testing-vars-str m)))
(defmethod report [::default :end-test-var] [m])
(defmethod report [::default :end-run-tests] [m])

(defn js-line-and-column [stack-element]
  (let [parts (.split stack-element ":")

(defmethod report [::default :pass] [m]
  (inc-report-counter! :pass))

(defn- print-comparison [m]
  (let [formatter-fn (or (:formatter (get-current-env)) pr-str)]
    (println "expected:" (formatter-fn (:expected m)))
    (println "  actual:" (formatter-fn (:actual m)))))

(defmethod report [::default :fail] [m]
  (inc-report-counter! :fail)
  (println "\nFAIL in" (testing-vars-str m))
  (when (seq (:testing-contexts (get-current-env)))
    (println (testing-contexts-str)))
  (when-let [message (:message m)] (println message))
  (print-comparison m))

(defmethod report [::default :error] [m]
  (inc-report-counter! :error)
