Skip to content

Commit

Permalink
Move common target variable to subtask
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmotta committed Dec 27, 2023
1 parent 22dc4b0 commit 8270947
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -335,30 +335,29 @@ shadow-server: export TARGET := clojure
shadow-server:##@ Start shadow-cljs in server mode for watching
yarn shadow-cljs server

_clojure-test: export TARGET := clojure
_clojure-test:
yarn install && \
yarn shadow-cljs compile mocks && \
yarn shadow-cljs compile test && \
node --require ./test-resources/override.js "$$SHADOW_OUTPUT_TO"

_clojure-test-watch: export TARGET := clojure
_clojure-test-watch:
yarn install && \
yarn shadow-cljs compile mocks && \
nodemon --exec "yarn shadow-cljs compile test && node --require ./test-resources/override.js $$SHADOW_OUTPUT_TO" -e cljs

test: export TARGET := clojure
test: export SHADOW_OUTPUT_TO := target/test/test.js
test: export SHADOW_NS_REGEXP := .*-test$$
test: ##@test Run all Clojure tests
test: _clojure-test

test-watch: export TARGET := clojure
test-watch: export SHADOW_OUTPUT_TO := target/test/test.js
test-watch: export SHADOW_NS_REGEXP := .*-test$$
test-watch: ##@test Watch all Clojure tests and re-run when files change
test-watch: _clojure-test-watch

test-watch-for-repl: export TARGET := clojure
test-watch-for-repl: export SHADOW_OUTPUT_TO := target/test/test.js
test-watch-for-repl: export SHADOW_NS_REGEXP := .*-test$$
test-watch-for-repl: ##@test Watch all Clojure tests and support REPL connections
Expand All @@ -369,25 +368,21 @@ test-watch-for-repl: ##@test Watch all Clojure tests and support REPL connection
'yarn shadow-cljs watch test --verbose' \
"until [ -f $$SHADOW_OUTPUT_TO ] ; do sleep 1 ; done ; node --require ./test-resources/override.js $$SHADOW_OUTPUT_TO --repl"

unit-test: export TARGET := clojure
unit-test: export SHADOW_OUTPUT_TO := target/unit_test/test.js
unit-test: export SHADOW_NS_REGEXP := ^(?!status-im\.integration-test).*-test$$
unit-test: ##@test Run unit tests
unit-test: _clojure-test

unit-test-watch: export TARGET := clojure
unit-test-watch: export SHADOW_OUTPUT_TO := target/unit_test/test.js
unit-test-watch: export SHADOW_NS_REGEXP := ^(?!status-im\.integration-test).*-test$$
unit-test-watch: ##@test Watch unit tests and re-run when files change
unit-test-watch: _clojure-test-watch

integration-test: export TARGET := clojure
integration-test: export SHADOW_OUTPUT_TO := target/integration_test/test.js
integration-test: export SHADOW_NS_REGEXP := ^status-im\.integration-test.*$$
integration-test: ##@test Run integration tests
integration-test: _clojure-test

integration-test-watch: export TARGET := clojure
integration-test-watch: export SHADOW_OUTPUT_TO := target/integration_test/test.js
integration-test-watch: export SHADOW_NS_REGEXP := ^status-im\.integration-test.*$$
integration-test-watch: ##@test Watch integration tests and re-run when files change
Expand Down

0 comments on commit 8270947

Please sign in to comment.