Add tsconfig-paths registration to mocha

pull/2191/head
Chocobozzz 2019-10-21 16:24:06 +02:00
parent e199856bb7
commit 4c8ef0ec68
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
6 changed files with 11 additions and 9 deletions

View File

@ -11,7 +11,7 @@ killall -q peertube || true
if [ "$1" = "misc" ]; then
npm run build -- --light-fr
mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/client.ts \
mocha --timeout 5000 --exit --require ts-node/register --require tsconfig-paths/register --bail server/tests/client.ts \
server/tests/feeds/index.ts \
server/tests/misc-endpoints.ts \
server/tests/helpers/index.ts \
@ -19,7 +19,7 @@ if [ "$1" = "misc" ]; then
elif [ "$1" = "cli" ]; then
npm run build:server
CC=gcc-4.9 CXX=g++-4.9 npm run setup:cli
mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/cli/index.ts
mocha --timeout 5000 --exit --require ts-node/register --require tsconfig-paths/register --bail server/tests/cli/index.ts
elif [ "$1" = "api-1" ]; then
npm run build:server
sh ./server/tests/api/ci-1.sh 2

View File

@ -7,4 +7,4 @@ npm run setup:cli
npm run ci -- lint
mocha --exit --require ts-node/register/type-check --bail server/tests/index.ts
mocha --exit --require ts-node/register/type-check --require tsconfig-paths/register --bail server/tests/index.ts

View File

@ -6,5 +6,5 @@ checkParamFiles=$(find server/tests/api/check-params -type f | grep -v index.ts
notificationsFiles=$(find server/tests/api/notifications -type f | grep -v index.ts | xargs echo)
searchFiles=$(find server/tests/api/search -type f | grep -v index.ts | xargs echo)
MOCHA_PARALLEL=true npm run mocha -- --timeout 30000 --exit --require ts-node/register --bail \
MOCHA_PARALLEL=true npm run mocha -- --timeout 30000 --exit --require ts-node/register --require tsconfig-paths/register --bail \
$notificationsFiles $searchFiles $checkParamFiles

View File

@ -5,5 +5,6 @@ set -eu
serverFiles=$(find server/tests/api/server -type f | grep -v index.ts | xargs echo)
usersFiles=$(find server/tests/api/users -type f | grep -v index.ts | xargs echo)
MOCHA_PARALLEL=true npm run mocha-parallel-tests -- --max-parallel $1 --timeout 30000 --exit --require ts-node/register --bail \
$serverFiles $usersFiles
MOCHA_PARALLEL=true npm run mocha-parallel-tests -- --max-parallel $1 --timeout 30000 --exit \
--require ts-node/register --require tsconfig-paths/register --bail \
$serverFiles $usersFiles

View File

@ -4,5 +4,5 @@ set -eu
videosFiles=$(find server/tests/api/videos -type f | grep -v index.ts | xargs echo)
npm run mocha -- --timeout 30000 --exit --require ts-node/register --bail \
npm run mocha -- --timeout 30000 --exit --require ts-node/register --require tsconfig-paths/register --bail \
$videosFiles

View File

@ -5,5 +5,6 @@ set -eu
redundancyFiles=$(find server/tests/api/redundancy -type f | grep -v index.ts | xargs echo)
activitypubFiles=$(find server/tests/api/activitypub -type f | grep -v index.ts | xargs echo)
MOCHA_PARALLEL=true npm run mocha-parallel-tests -- --max-parallel $1 --timeout 30000 --exit --require ts-node/register --bail \
$redundancyFiles $activitypubFiles
MOCHA_PARALLEL=true npm run mocha-parallel-tests -- --max-parallel $1 --timeout 30000 --exit \
--require ts-node/register --require tsconfig-paths/register --bail \
$redundancyFiles $activitypubFiles