0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-11 15:21:18 -05:00

Add watch:tests command to tools.clj script.

This commit is contained in:
Andrey Antukh 2019-09-21 11:41:18 +00:00
parent 0be3a181e6
commit d8edf07367

View file

@ -130,12 +130,9 @@
(task ["dbg-dist:main"])
(task ["dbg-dist:worker"]))
;; --- Tests Tasks
(defmethod task "build-tests"
(defmethod task "build:tests"
[& args]
(api/build (api/inputs "src" "test")
(assoc default-build-options
@ -147,6 +144,30 @@
:output-dir "target/tests/main"
:optimizations :none)))
(defmethod task "watch:tests"
[args]
(println "Start watch loop...")
(letfn [(run-tests []
(let [{:keys [out err]} (shell/sh "node" "target/tests/main.js")]
(println out err)))
(start-watch []
(try
(api/watch (api/inputs "src" "test")
(assoc default-build-options
:main 'uxbox.tests.main
:watch-fn run-tests
:target :nodejs
:source-map true
:output-to "target/tests/main.js"
:output-dir "target/tests/main"
:optimizations :none))
(catch Exception e
(println "ERROR:" e)
(Thread/sleep 2000)
start-watch)))]
(trampoline start-watch)))
;; --- Figwheel Config & Tasks
(def figwheel-builds