diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 61df062..3f99535 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -78,9 +78,19 @@ jobs: working-directory: ./backend run: npx tsc --noEmit - - name: Run backend tests + - name: Check if tests exist and run them 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 uses: actions/setup-python@v4