travis.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. set -eu
  3. if [ $# -eq 0 ]; then
  4. echo "Need test suite argument."
  5. exit -1
  6. fi
  7. killall -q peertube || true
  8. if [ "$1" = "misc" ]; then
  9. npm run build -- --light-fr
  10. mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/client.ts \
  11. server/tests/feeds/index.ts \
  12. server/tests/misc-endpoints.ts \
  13. server/tests/helpers/index.ts
  14. elif [ "$1" = "cli" ]; then
  15. npm run build:server
  16. mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/cli/index.ts
  17. elif [ "$1" = "api-1" ]; then
  18. npm run build:server
  19. mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/api/index-1.ts
  20. elif [ "$1" = "api-2" ]; then
  21. npm run build:server
  22. mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/api/index-2.ts
  23. elif [ "$1" = "api-3" ]; then
  24. npm run build:server
  25. mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/api/index-3.ts
  26. elif [ "$1" = "api-4" ]; then
  27. npm run build:server
  28. mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/api/index-4.ts
  29. elif [ "$1" = "lint" ]; then
  30. npm run tslint -- --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" "shared/**/*.ts"
  31. ( cd client
  32. npm run lint
  33. )
  34. elif [ "$1" = "jest" ]; then
  35. ( cd client
  36. npm run test
  37. )
  38. fi