2013-07-26 20:31:24 +02:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
2013-08-20 06:15:41 +02:00
|
|
|
cd "$(dirname "$0")"/..
|
2013-07-27 00:03:46 +02:00
|
|
|
|
2013-12-02 23:46:09 +01:00
|
|
|
export NODE_PATH=/usr/lib/nodejs:static
|
2013-08-01 17:53:10 +02:00
|
|
|
|
2015-10-13 23:34:50 +02:00
|
|
|
INDEX_JS=frontend_tests/node/index.js
|
2013-07-30 23:54:33 +02:00
|
|
|
NODEJS=$(which nodejs || which node)
|
2015-09-26 03:47:30 +02:00
|
|
|
if [ "$1" = "cover" ]; then
|
2013-08-20 06:20:02 +02:00
|
|
|
# Run a coverage test with Istanbul.
|
2015-09-26 03:47:30 +02:00
|
|
|
istanbul cover "$INDEX_JS"
|
2013-08-20 06:20:02 +02:00
|
|
|
else
|
|
|
|
# Normal testing, no coverage analysis.
|
|
|
|
# Run the index.js test runner, which runs all the other tests.
|
2015-09-26 03:47:30 +02:00
|
|
|
"$NODEJS" --stack-trace-limit=100 "$INDEX_JS"
|
2013-08-20 06:20:02 +02:00
|
|
|
fi
|