Fix doo & test result component on demo app

This commit is contained in:
Juho Teperi 2017-10-13 16:00:04 +03:00
parent f590c342eb
commit b81af9308a
2 changed files with 7 additions and 3 deletions

View File

@ -6,7 +6,8 @@
[reagentdemo.intro :as intro]
[reagentdemo.news :as news]
[reagenttest.runtests :as tests]
[reagent.debug :refer-macros [dbg println]]))
[reagent.debug :refer-macros [dbg println]]
[doo.runner :as doo]))
(def github {:href "https://github.com/reagent-project/reagent"})
@ -31,11 +32,12 @@
[:li [link {:href news/url} "News"]]
[:li>a github "GitHub"]
[:li [:a {:href "http://reagent-project.github.io/docs/master/"} "API"]]]
[:div @tests/test-results]
[:div @tests/test-results-component]
[tools/main-content]
[github-badge]])
(defn init! []
(doo/set-exit-point! (fn [success?] nil))
(tests/init!)
(tools/start! {:body [#'demo]
:title-prefix "Reagent: "

View File

@ -49,10 +49,12 @@
(:fail res) " failures, " (:error res) " errors."])
"testing")]))
(def test-results-component (r/atom nil))
(defn init! []
(when (some? (test/deftest empty-test))
;; Only run with :load-tests true
(reset! test-results [#'test-output-mini])
(reset! test-results-component [#'test-output-mini])
(run-tests)))
(doo-tests 'reagenttest.testreagent