mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 19:06:18 +00:00
✨ Add watch:tests command to tools.clj script.
This commit is contained in:
parent
0be3a181e6
commit
d8edf07367
@ -130,12 +130,9 @@
|
|||||||
(task ["dbg-dist:main"])
|
(task ["dbg-dist:main"])
|
||||||
(task ["dbg-dist:worker"]))
|
(task ["dbg-dist:worker"]))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; --- Tests Tasks
|
;; --- Tests Tasks
|
||||||
|
|
||||||
(defmethod task "build-tests"
|
(defmethod task "build:tests"
|
||||||
[& args]
|
[& args]
|
||||||
(api/build (api/inputs "src" "test")
|
(api/build (api/inputs "src" "test")
|
||||||
(assoc default-build-options
|
(assoc default-build-options
|
||||||
@ -147,6 +144,30 @@
|
|||||||
:output-dir "target/tests/main"
|
:output-dir "target/tests/main"
|
||||||
:optimizations :none)))
|
: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
|
;; --- Figwheel Config & Tasks
|
||||||
|
|
||||||
(def figwheel-builds
|
(def figwheel-builds
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user