mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-12-01 06:55:45 +01:00
added test checks before running tests
This commit is contained in:
14
.github/workflows/docker.yml
vendored
14
.github/workflows/docker.yml
vendored
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user