mirror of https://github.com/status-im/reagent.git
Support running site in dev mode without tests
This commit is contained in:
parent
19a384443f
commit
7568b6843e
4
Makefile
4
Makefile
|
@ -17,6 +17,10 @@ run: figwheel
|
|||
runsite:
|
||||
@$(MAKE) run PROF=dev,site,$(PROF)
|
||||
|
||||
# development build with figwheel, but no tests
|
||||
runnotest:
|
||||
@$(MAKE) run PROF=dev-notest,$(PROF)
|
||||
|
||||
# production build with auto-rebuild
|
||||
runprod: clean
|
||||
@$(MAKE) serve-site PROF=prod,$(PROF)
|
||||
|
|
39
project.clj
39
project.clj
|
@ -14,21 +14,22 @@
|
|||
:profiles {:test {:cljsbuild
|
||||
{:builds {:client {:source-paths ["test"]}}}}
|
||||
|
||||
:dev-base {:dependencies [[figwheel "0.2.3-SNAPSHOT"]]
|
||||
:plugins [[lein-figwheel "0.2.3-SNAPSHOT"]]
|
||||
:source-paths ["demo"] ;; for lighttable
|
||||
:resource-paths ["site" "outsite"]
|
||||
:figwheel {:css-dirs ["site/public/css"]}
|
||||
:cljsbuild
|
||||
{:builds
|
||||
{:client
|
||||
{:source-paths ["env/dev"]
|
||||
:compiler {:main "reagentdemo.dev"
|
||||
:source-map true
|
||||
:source-map-timestamp true
|
||||
:optimizations :none
|
||||
:output-dir "outsite/public/js/out"
|
||||
:asset-path "js/out"}}}}}
|
||||
:dev [:test
|
||||
{:dependencies [[figwheel "0.2.3-SNAPSHOT"]]
|
||||
:plugins [[lein-figwheel "0.2.3-SNAPSHOT"]]
|
||||
:source-paths ["demo"] ;; for lighttable
|
||||
:resource-paths ["site" "outsite"]
|
||||
:figwheel {:css-dirs ["site/public/css"]}
|
||||
:cljsbuild
|
||||
{:builds
|
||||
{:client
|
||||
{:source-paths ["env/dev"]
|
||||
:compiler {:main "reagentdemo.dev"
|
||||
:source-map true
|
||||
:source-map-timestamp true
|
||||
:optimizations :none
|
||||
:output-dir "outsite/public/js/out"
|
||||
:asset-path "js/out"}}}}}]
|
||||
|
||||
:site {:resource-paths ^:replace ["outsite"]
|
||||
:figwheel {:css-dirs ^:replace ["outsite/public/css"]}
|
||||
|
@ -43,9 +44,13 @@
|
|||
:elide-asserts true
|
||||
:pretty-print false
|
||||
:output-dir "target/client"}}}}}]
|
||||
|
||||
:prod-test [:test :prod]
|
||||
|
||||
:dev [:test :dev-base]
|
||||
:prod-test [:test :prod]}
|
||||
:dev-notest [:dev
|
||||
{:cljsbuild
|
||||
{:builds {:client
|
||||
{:compiler {:load-tests false}}}}}]}
|
||||
|
||||
:clean-targets ^{:protect false} [:target-path :compile-path
|
||||
"outsite/public/js"
|
||||
|
|
|
@ -44,5 +44,7 @@
|
|||
(js/setTimeout all-tests 100)
|
||||
(all-tests)))
|
||||
|
||||
(reset! demo/test-results [#'test-output-mini])
|
||||
(run-tests)
|
||||
(when (some? (test/deftest empty-test))
|
||||
;; Only run with :load-tests true
|
||||
(reset! demo/test-results [#'test-output-mini])
|
||||
(run-tests))
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
;; this repeats all the atom tests but using cursors instead
|
||||
|
||||
(set! rv/debug true)
|
||||
|
||||
(defn running [] (rv/running))
|
||||
(defn running []
|
||||
(set! rv/debug true)
|
||||
(rv/running))
|
||||
(defn dispose [v] (rv/dispose! v))
|
||||
|
||||
(deftest basic-cursor
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
|
||||
(defn running [] (rv/running))
|
||||
|
||||
(def isClient (not (nil? (try (.-document js/window)
|
||||
(catch js/Object e nil)))))
|
||||
(def isClient reagent/is-client)
|
||||
|
||||
(def rflush reagent/flush)
|
||||
|
||||
|
|
Loading…
Reference in New Issue