From 0256642f6433e79a7d18f95992b1abd4d19f7a69 Mon Sep 17 00:00:00 2001 From: Juho Teperi Date: Wed, 22 Jan 2025 13:57:10 +0200 Subject: [PATCH] Add bb tasks for Cljs tests --- Justfile | 10 ---------- bb.edn | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 10 deletions(-) delete mode 100644 Justfile create mode 100644 bb.edn diff --git a/Justfile b/Justfile deleted file mode 100644 index 0487b8ac..00000000 --- a/Justfile +++ /dev/null @@ -1,10 +0,0 @@ -help: - @just --list - -# Initializes lint -init-lint: - clj-kondo --lint $(lein classpath) - -# Lints the project -lint: - ./lint.sh diff --git a/bb.edn b/bb.edn new file mode 100644 index 00000000..bb520cb2 --- /dev/null +++ b/bb.edn @@ -0,0 +1,26 @@ +{:tasks + {init-lint {:task (shell "sh -c" "clj-kondo --copy-configs --lint $(lein classpath)")} + lint {:doc "Run clj-kondo" + :task (shell "./lint.sh")} + + watch-node-test {:doc "Watch files for changes and run Cljs tests on Node.js" + :task (shell "npx shadow-cljs watch node-test")} + node-test {:doc "Compile and run Cljs tests" + :task (shell "npx shadow-cljs compile node-test")} + + watch-browser-test-local {:doc "Start watching Cljs tests for changes and start HTTP server for running tests in a local browser" + :task (shell "npx shadow-cljs watch browser-test")} + + ;; Karma watch needs to file to exist before start + -karma-placeholder (shell "sh -c" "mkdir -p target/karma && touch target/karma/ci.js") + -watch-karma-cljs {:depends [-karma-placeholder] + :task (shell "npx shadow-cljs watch karma")} + -watch-karma-test (shell "npx karma start") + -watch-karma {:depends [-watch-karma-cljs -watch-karma-test]} + watch-karma {:doc "Watch Cljs tests for changes, compile for Karma and run Karma tests on changes" + :task (run '-watch-karma {:parallel true})} + + test-karma {:doc "Compile Cljs tests and run using Karma once" + :task (do + (shell "npx shadow-cljs compile karma") + (shell "npx karma start --single-run"))}}}