Last active
May 31, 2018 14:52
-
-
Save viesti/bba5c88abbb2f6ecb914 to your computer and use it in GitHub Desktop.
Custom reporter for cljs.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns myapp.test | |
(:require [cljs.test :as test :refer-macros [deftest is] :refer [report]])) | |
(enable-console-print!) | |
(defmethod report [:karma :begin-test-ns] [m] | |
(println "\nTesting with Karma" (name (:ns m)))) | |
(defmethod report [:karma :summary] [m] | |
(println "All done")) | |
(println "custom report method:" (get-method report [:karma :begin-test-ns])) | |
(deftest foo | |
(is (= 1 1))) | |
(test/run-tests (test/empty-env :karma)) | |
ClojureScript:cljs.user> (require 'myapp.test :reload) | |
custom report method: #<function (m){ | |
return cljs.core.println.call(null,"\nTesting with Karma",cljs.core.name.call(null,new cljs.core.Keyword(null,"ns","ns",441598760).cljs$core$IFn$_invoke$arity$1(m))); | |
}> | |
Testing myapp.test | |
Ran 1 tests containing 1 assertions. | |
0 failures, 0 errors. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment