Rerun tests by clicking on test results

This commit is contained in:
Dan Holmsand 2016-04-29 13:17:54 +02:00
parent e801b8e29a
commit 8ff44c81e6
1 changed files with 8 additions and 7 deletions

View File

@ -32,9 +32,16 @@
(+ (:pass m) (:fail m) (:error m)) "assertions.")
(println (:fail m) "failures," (:error m) "errors."))
(defn run-tests []
(reset! test-results nil)
(if r/is-client
(js/setTimeout all-tests 100)
(all-tests)))
(defn test-output-mini []
(let [res @test-results]
[:div {:style test-box-style}
[:div {:style test-box-style
:on-click run-tests}
(if res
(if (zero? (+ (:fail res) (:error res)))
"All tests ok"
@ -42,12 +49,6 @@
(:fail res) " failures, " (:error res) " errors."])
"testing")]))
(defn run-tests []
(reset! test-results nil)
(if r/is-client
(js/setTimeout all-tests 100)
(all-tests)))
(defn init! []
(when (some? (test/deftest empty-test))
;; Only run with :load-tests true