]>
Commit | Line | Data |
---|---|---|
0e4ffb4b LA |
1 | #!/bin/sh |
2 | ||
3 | set -eu | |
18530063 C |
4 | |
5 | if [ $# -eq 0 ]; then | |
6 | echo "Need test suite argument." | |
7 | exit -1 | |
8 | fi | |
9 | ||
365b546c C |
10 | killall -q peertube || true |
11 | ||
98ec8b8e | 12 | if [ "$1" = "misc" ]; then |
3bacf661 | 13 | npm run build -- --light-fr |
0e5ff97f | 14 | mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/client.ts \ |
0e5ff97f BY |
15 | server/tests/feeds/index.ts \ |
16 | server/tests/misc-endpoints.ts \ | |
17 | server/tests/helpers/index.ts | |
18530063 | 18 | elif [ "$1" = "api" ]; then |
1b6b4757 | 19 | npm run build:server |
c710f90a | 20 | mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index.ts |
18530063 | 21 | elif [ "$1" = "cli" ]; then |
1b6b4757 | 22 | npm run build:server |
c710f90a | 23 | mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/cli/index.ts |
1297eb5d | 24 | elif [ "$1" = "api-1" ]; then |
15f25480 | 25 | npm run build:server |
1297eb5d C |
26 | mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-1.ts |
27 | elif [ "$1" = "api-2" ]; then | |
15f25480 | 28 | npm run build:server |
1297eb5d C |
29 | mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-2.ts |
30 | elif [ "$1" = "api-3" ]; then | |
31 | npm run build:server | |
32 | mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-3.ts | |
2fbe7f19 | 33 | elif [ "$1" = "api-4" ]; then |
26370ce4 C |
34 | npm run build:server |
35 | mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-4.ts | |
18530063 | 36 | elif [ "$1" = "lint" ]; then |
f2659ae0 C |
37 | npm run tslint -- --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" "shared/**/*.ts" |
38 | ||
0e4ffb4b LA |
39 | ( cd client |
40 | npm run lint | |
41 | ) | |
f2659ae0 | 42 | elif [ "$1" = "jest" ]; then |
7f5f4152 BJ |
43 | ( cd client |
44 | npm run test | |
45 | ) | |
18530063 | 46 | fi |