twenty/server/scripts/run-integration.sh
Charles Bochet 2d758c990b
Fix merge issue flexible backend (#1685)
* Fix merge issue flexible backend

* Fix tests

* Try fix tests

* Try fix tests
2023-09-20 19:11:21 -07:00

20 lines
489 B
Bash
Executable File

#!/usr/bin/env bash
# src/run-integration.sh
DIR="$(cd "$(dirname "$0")" && pwd)"
source $DIR/set-env-test.sh
npx ts-node ./test/utils/check-db.ts
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo '🟡 - Database is not initialized. Running migrations...'
npx ts-node ./test/utils/setup-db.ts
npx prisma migrate reset --force && yarn prisma:generate
yarn typeorm:migrate
else
echo "🟢 - Database is already initialized."
fi
yarn jest --config ./test/jest-e2e.json