autotest-js.sh 544 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env bash
  2. #
  3. # ownCloud
  4. #
  5. # Run JS tests
  6. #
  7. # @author Vincent Petry
  8. # @copyright 2014 Vincent Petry <pvince81@owncloud.com>
  9. #
  10. # set -e
  11. NPM="$(which npm 2>/dev/null)"
  12. PREFIX="build"
  13. if test -z "$NPM"
  14. then
  15. echo 'Node JS >= 0.8 is required to run the JavaScript tests' >&2
  16. exit 1
  17. fi
  18. # update/install test packages
  19. mkdir -p "$PREFIX" && $NPM install --link --prefix "$PREFIX" || exit 3
  20. KARMA="$PREFIX/node_modules/karma/bin/karma"
  21. NODE_PATH='build/node_modules' KARMA_TESTSUITE="$1" $KARMA start tests/karma.config.js --single-run