https://github.com/ctlab/phantasus
Revision afd1a5fe98bba9b79f405fe91380ae91cdaaca2b authored by baba-beda on 29 September 2017, 13:56:03 UTC, committed by baba-beda on 29 September 2017, 13:56:03 UTC
1 parent f8e91e9
Tip revision: afd1a5fe98bba9b79f405fe91380ae91cdaaca2b authored by baba-beda on 29 September 2017, 13:56:03 UTC
updated tutorial
updated tutorial
Tip revision: afd1a5f
test_js.sh
#!/bin/bash
R -e "devtools::install('.')"
cd inst/www/phantasus.js/
npm install karma --save-dev
npm install
R -e "phantasus::servePhantasus('0.0.0.0', 8000, cacheDir = file.path(getwd(), 'jasmine', 'cache'), preloadedDir = file.path(getwd(), 'jasmine', 'cache'))" &
PH_PID=$!
sleep 2
./node_modules/karma/bin/karma start my.conf.js --single-run
RETVAL=$?
cd
function finish {
kill $PH_PID
echo "Killed OpenCPU-server"
}
trap finish EXIT
if [ $RETVAL -eq 0 ]
then
echo "Jasmine tests are successfully passed"
exit 0
else
echo "Tests failed" >&2
exit 1
fi
Computing file changes ...