From dfd3e540f3d38e23a7292efc583a1ff5bdba29bd Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Sat, 31 Jan 2015 23:09:42 +0100 Subject: [PATCH] Use cljs.test --- project.clj | 3 +-- test/runtests.cljs | 11 +++++++++-- test/testcursor.cljs | 9 +++------ test/testinterop.cljs | 2 +- test/testratom.cljs | 10 ++++------ test/testreagent.cljs | 11 ++++------- test/testwrap.cljs | 2 +- 7 files changed, 23 insertions(+), 25 deletions(-) diff --git a/project.clj b/project.clj index 82311aa..f07aede 100644 --- a/project.clj +++ b/project.clj @@ -20,8 +20,7 @@ "examples/simple/src" "examples/geometry/src"]}}}} - :test {:dependencies [[com.cemerick/clojurescript.test "0.3.1"]] - :cljsbuild {:builds + :test {:cljsbuild {:builds {:client {:source-paths ["test"]}}}} :dev-base {:dependencies diff --git a/test/runtests.cljs b/test/runtests.cljs index 9854123..fdc18f4 100644 --- a/test/runtests.cljs +++ b/test/runtests.cljs @@ -5,11 +5,18 @@ [testinterop] [testratom] [testwrap] - [cemerick.cljs.test :as t] + [cljs.test :as test :include-macros true] [reagent.core :as reagent :refer [atom]] [reagent.interop :refer-macros [.' .!]] [reagent.debug :refer-macros [dbg println]])) +(defn all-tests [] + (test/run-tests 'testreagent + 'testcursor + 'testinterop + 'testratom + 'testwrap)) + (enable-console-print!) (def test-results (atom nil)) @@ -41,7 +48,7 @@ (defn ^:export run-all-tests [] (println "-----------------------------------------") (try - (reset! test-results (t/run-all-tests)) + (reset! test-results (all-tests)) (catch js/Object e (do (println "Testrun failed\n" e "\n" (.-stack e)) diff --git a/test/testcursor.cljs b/test/testcursor.cljs index 3e9ece6..c8d15b2 100644 --- a/test/testcursor.cljs +++ b/test/testcursor.cljs @@ -1,10 +1,7 @@ (ns testcursor - (:require-macros [cemerick.cljs.test - :refer (is deftest with-test run-tests testing)] - [reagent.ratom :refer [run! reaction]] - [reagent.debug :refer [dbg]]) - (:require [cemerick.cljs.test :as t] - [reagent.ratom :as rv] + (:require [cljs.test :as t :refer-macros [is deftest testing]] + [reagent.ratom :as rv :refer-macros [run! reaction]] + [reagent.debug :refer-macros [dbg]] [reagent.core :as r])) ;; this repeats all the atom tests but using cursors instead diff --git a/test/testinterop.cljs b/test/testinterop.cljs index 9cf3bd9..0c3ad32 100644 --- a/test/testinterop.cljs +++ b/test/testinterop.cljs @@ -1,5 +1,5 @@ (ns testinterop - (:require [cemerick.cljs.test :as t :refer-macros [is deftest]] + (:require [cljs.test :as t :refer-macros [is deftest]] [reagent.debug :refer-macros [dbg]] [reagent.interop :refer-macros [.' .! fvar fvar?]])) diff --git a/test/testratom.cljs b/test/testratom.cljs index 33136a3..6a0079a 100644 --- a/test/testratom.cljs +++ b/test/testratom.cljs @@ -1,10 +1,8 @@ (ns testratom - (:require-macros [cemerick.cljs.test - :refer (is deftest with-test run-tests testing)] - [reagent.ratom :refer [run! reaction]] - [reagent.debug :refer [dbg]]) - (:require [cemerick.cljs.test :as t] - [reagent.ratom :as rv])) + (:require [cljs.test :as t :refer-macros [is deftest testing]] + [reagent.ratom :as rv :refer-macros [run! reaction]] + [reagent.debug :refer-macros [dbg]] + [reagent.core :as r])) (defn running [] (set! rv/debug true) diff --git a/test/testreagent.cljs b/test/testreagent.cljs index be4c16c..8262012 100644 --- a/test/testreagent.cljs +++ b/test/testreagent.cljs @@ -1,11 +1,8 @@ (ns testreagent - (:require-macros [cemerick.cljs.test - :refer (is deftest with-test run-tests testing)] - [reagent.ratom :refer [reaction]] - [reagent.debug :refer [dbg println log]]) - (:require [cemerick.cljs.test :as t] - [reagent.core :as reagent :refer [atom]] - [reagent.ratom :as rv])) + (:require [cljs.test :as t :refer-macros [is deftest testing]] + [reagent.ratom :as rv :refer-macros [reaction]] + [reagent.debug :refer-macros [dbg println log]] + [reagent.core :as reagent :refer [atom]])) (defn running [] (rv/running)) diff --git a/test/testwrap.cljs b/test/testwrap.cljs index 14dba6d..f9bd477 100644 --- a/test/testwrap.cljs +++ b/test/testwrap.cljs @@ -1,5 +1,5 @@ (ns testwrap - (:require [cemerick.cljs.test :as t :refer-macros [is deftest]] + (:require [cljs.test :as t :refer-macros [is deftest]] [reagent.debug :refer-macros [dbg println log]] [reagent.core :as r :refer [atom wrap]]))