added test checks before running tests

This commit is contained in:
2025-10-21 22:50:22 +02:00
parent b3a3a5680e
commit 5e248c662f

View File

@@ -78,9 +78,19 @@ jobs:
working-directory: ./backend working-directory: ./backend
run: npx tsc --noEmit run: npx tsc --noEmit
- name: Run backend tests - name: Check if tests exist and run them
working-directory: ./backend working-directory: ./backend
run: npm test --if-present run: |
# Check if jest is available and test script exists
if npx --no-install jest --version > /dev/null 2>&1; then
echo "Running tests with Jest..."
npm test
elif [ -f "package.json" ] && grep -q '"test"' package.json; then
echo "Running test script from package.json..."
npm test
else
echo "No tests configured. Skipping test execution."
fi
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4