Skip to content

Commit b52d58e

Browse files
authored
tests: no longer need to install karma-cli (#225)
Our cljs browser tests are run via cljs-test-runner which uses doo. Doo docs recommended installing karma-cli globally. karma-cli makes the karma command effectively visible on the PATH. But we can tell clj-test-runner to tell doo to run karma via `npx karma` instead. This way we invoke our locally installed karma without this karma-cli dependency. Fixes #224. Regardless, seems like an improvement to have one less dev setup step and one less npm install.
1 parent 81dbd16 commit b52d58e

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

.github/workflows/unit-test.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,6 @@ jobs:
156156
planck --version
157157
if: matrix.os != 'windows'
158158

159-
#
160-
# Node modules
161-
#
162-
- name: Install karma command line (windows)
163-
run: npm install karma-cli -g
164-
if: matrix.os == 'windows'
165-
- name: Install karma command line (macos, linux)
166-
run: sudo npm install karma-cli -g
167-
if: matrix.os != 'windows'
168-
169159
- name: Install node modules
170160
run: npm install
171161

doc/02-developer-guide.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ After checking out this project from GitHub,
6767
1. Install JavaScript libraries and tools required by https://github.com/bensu/doo[doo] and https://github.com/thheller/shadow-cljs[shadow-cljs]:
6868
+
6969
----
70-
sudo npm install karma-cli -g
7170
npm install
7271
----
7372

script/test_cljs.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
:source-map (= "none" optimizations)})
2323

2424
(defn doo-opts [test-combo]
25-
{:karma
25+
{:paths {:karma "npx karma"}
26+
:karma
2627
{:config {"plugins" ["karma-spec-reporter" "karma-junit-reporter"]
2728
"reporters" ["spec" "junit"]
2829
"specReporter" {"suppressSkipped" "false"

0 commit comments

Comments
 (0)