Skip to content

Commit

Permalink
Merge pull request #37 from jesims/JESI-2652
Browse files Browse the repository at this point in the history
  • Loading branch information
axrs committed May 1, 2019
2 parents ee17baa + 8588487 commit b3eb5eb
Show file tree
Hide file tree
Showing 9 changed files with 667 additions and 1,283 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.28
0.0.29
27 changes: 18 additions & 9 deletions backpack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ if [[ $? -ne 0 ]]; then
exit 1
fi

shadow-cljs () {
lein trampoline run -m shadow.cljs.devtools.cli $@
}

## clean:
## Cleans up the compiled and generated sources
clean () {
Expand All @@ -28,15 +32,15 @@ deps () {
## Generate api documentation
docs () {
echo_message 'Generating API documentation'
# commented out until https://github.com/weavejester/codox/issues/166 is fixed
# commented out until https://github.com/weavejester/codox/issues/166 is fixed
# lein codox
# abort_on_error
}

## stop:
## Stops shadow-cljs and karma
stop () {
npx shadow-cljs stop &>/dev/null
shadow-cljs stop &>/dev/null
pkill -f 'karma ' &>/dev/null
}

Expand Down Expand Up @@ -66,13 +70,13 @@ unit-test () {
}

unit-test-node () {
npx shadow-cljs compile node \
shadow-cljs compile node \
&& node target/node/test.js
abort_on_error 'node tests failed'
}

unit-test-karma () {
npx shadow-cljs compile karma \
shadow-cljs compile karma \
&& npx karma start --single-run
abort_on_error 'kamra tests failed'
}
Expand All @@ -81,34 +85,39 @@ unit-test-browser-refresh () {
clean
trap stop EXIT
open http://localhost:8091/
npx shadow-cljs watch browser
shadow-cljs watch browser
abort_on_error
}

unit-test-cljs-refresh () {
clean
echo_message 'In a few special places, these clojure changes create some of the greatest transformation spectacles on earth'
npx shadow-cljs compile karma
shadow-cljs compile karma
abort_on_error
trap stop EXIT
npx karma start --no-single-run &
npx shadow-cljs watch karma
shadow-cljs watch karma
}

## unit-test-cljs:
## args: [-b|-n|-r]
## args: [-k|-b|-n|-r] [test-ns-regex]
## Runs the ClojureScript unit tests
## [-k] Watches and compiles tests for execution with karma (Default)
## [-b] Watches and compiles tests for execution within a browser
## [-n] Executes the tests targeting Node.js
## [-r] Watches tests and source files for changes, and subsequently re-evaluates
## [-r] Watches tests and source files for changes, and subsequently re-evaluates with karma
## [test-ns-regex] Watches tests and source files for changes, and subsequently re-evaluates
unit-test-cljs () {
export TEST_NS_REGEXP=${2:-'-test$'}
case $1 in
-r)
unit-test-cljs-refresh;;
-b)
unit-test-browser-refresh;;
-n)
unit-test-node;;
-k)
unit-test-karma;;
*)
unit-test-karma;;
esac
Expand Down
3 changes: 1 addition & 2 deletions package-dry.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
"dry": {
"extends": "@io.jesi/parent/package-dry.json",
"dependencies": {
"@io.jesi/parent": "0.0.4"
"@io.jesi/parent": "0.0.7"
}
},
"devDependencies": {
"karma": "managed",
"karma-chrome-launcher": "managed",
"karma-cljs-test": "managed",
"shadow-cljs": "managed",
"standard": "managed"
}
}

0 comments on commit b3eb5eb

Please sign in to comment.