test-js-with-node: Fix return status on failure.

This commit is contained in:
Tim Abbott 2016-08-04 09:27:54 -07:00
parent 1d6ebd2b3d
commit 82b1218af9
1 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ INDEX_JS=frontend_tests/zjsunit/index.js
NODEJS=$(which nodejs || which node)
if [ "$1" = "cover" ]; then
# Run a coverage test with Istanbul.
istanbul cover "$INDEX_JS" && echo "Test(s) passed. SUCCESS!" || echo "FAIL - Test(s) failed"
istanbul cover "$INDEX_JS" && echo "Test(s) passed. SUCCESS!" || (echo "FAIL - Test(s) failed"; exit 1)
elif [ "$1" = "-h" -o "$1" = "--help" ]; then
echo "Usage:
@ -23,5 +23,5 @@ elif [ "$1" = "-h" -o "$1" = "--help" ]; then
else
# Normal testing, no coverage analysis.
# Run the index.js test runner, which runs all the other tests.
"$NODEJS" --stack-trace-limit=100 "$INDEX_JS" $@ && echo "Test(s) passed. SUCCESS!" || echo "FAIL - Test(s) failed"
"$NODEJS" --stack-trace-limit=100 "$INDEX_JS" $@ && echo "Test(s) passed. SUCCESS!" || (echo "FAIL - Test(s) failed"; exit 1)
fi