travis.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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/type-check --bail server/tests/client.ts server/tests/activitypub.ts \
  11. server/tests/feeds/index.ts
  12. elif [ "$1" = "api" ]; then
  13. npm run build:server
  14. mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index.ts
  15. elif [ "$1" = "cli" ]; then
  16. npm run build:server
  17. mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/cli/index.ts
  18. elif [ "$1" = "api-1" ]; then
  19. npm run build:server
  20. mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-1.ts
  21. elif [ "$1" = "api-2" ]; then
  22. npm run build:server
  23. mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-2.ts
  24. elif [ "$1" = "api-3" ]; then
  25. npm run build:server
  26. mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-3.ts
  27. elif [ "$1" = "lint" ]; then
  28. ( cd client
  29. npm run lint
  30. )
  31. elif [ "$1" = "jest" ]; then
  32. ( cd client
  33. npm run test
  34. )
  35. npm run tslint -- --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" "shared/**/*.ts"
  36. fi