From f3bdec089bdb2e912b2dbf69d7562e07509a72b3 Mon Sep 17 00:00:00 2001 From: SevenOfAces Date: Mon, 18 Nov 2024 20:50:17 -0800 Subject: [PATCH] deleted: .forgejo/workflows/run-tests.sh modified: .forgejo/workflows/test.yml modified: package.json --- .forgejo/workflows/run-tests.sh | 19 ------------------- .forgejo/workflows/test.yml | 7 ++----- package.json | 2 +- 3 files changed, 3 insertions(+), 25 deletions(-) delete mode 100644 .forgejo/workflows/run-tests.sh diff --git a/.forgejo/workflows/run-tests.sh b/.forgejo/workflows/run-tests.sh deleted file mode 100644 index f9f9830..0000000 --- a/.forgejo/workflows/run-tests.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/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 e6d89fe..5ecdfaa 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -24,11 +24,8 @@ jobs: - name: Install dependencies run: npm ci - - name: Set up Unit test script - run: chmod +x ./.forgejo/workflows/run-tests.sh - - - name: Run Unit tests - run: ./.forgejo/workflows/run-tests.sh + - name: Run Unit tests + run: npm run test:unit - name: Run E2E tests run: npm run test:e2e \ No newline at end of file diff --git a/package.json b/package.json index 5e7d81f..f153946 100755 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "dev": "vite", "build": "run-p type-check \"build-only {@}\" --", "preview": "vite preview", - "test:unit": "npm run test:unit || (if grep -q 'No tests found' ./test-output.log; then exit 0; else exit 1; fi)", + "test:unit": "vitest", "test:e2e": "start-server-and-test preview http://localhost:4173 'cypress run --e2e'", "test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'", "build-only": "vite build",