From cd7536704510838010d570892880af7e83928954 Mon Sep 17 00:00:00 2001 From: SevenOfAces Date: Mon, 18 Nov 2024 20:44:49 -0800 Subject: [PATCH] new file: .forgejo/workflows/run-tests.sh modified: .forgejo/workflows/test.yml --- .forgejo/workflows/run-tests.sh | 19 +++++++++++++++++++ .forgejo/workflows/test.yml | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .forgejo/workflows/run-tests.sh diff --git a/.forgejo/workflows/run-tests.sh b/.forgejo/workflows/run-tests.sh new file mode 100644 index 0000000..f9f9830 --- /dev/null +++ b/.forgejo/workflows/run-tests.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Run the tests and capture the output +npm run test:unit > test-output.log 2>&1 + +# Check if 'No tests found' is in the log +if grep -q 'No tests found' test-output.log; then + echo "No tests found. Exiting with status 0." + exit 0 +else + # Check if the test run was successful + if [ $? -eq 0 ]; then + echo "Tests executed successfully." + exit 0 + else + echo "Tests failed. Exiting with status 1." + exit 1 + fi +fi diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index 5ecdfaa..b8e7c4d 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -24,8 +24,8 @@ jobs: - name: Install dependencies run: npm ci - - name: Run Unit tests - run: npm run test:unit + - name: Run Unit tests + run: ./.forgejo/workflows/run-tests.sh - name: Run E2E tests run: npm run test:e2e \ No newline at end of file