deleted: .forgejo/workflows/run-tests.sh
Some checks failed
Testing / test (push) Failing after 50s

modified:   .forgejo/workflows/test.yml
	modified:   package.json
This commit is contained in:
Mrrp 2024-11-18 20:50:17 -08:00
parent 8baba8a426
commit f3bdec089b
3 changed files with 3 additions and 25 deletions

View file

@ -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

View file

@ -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
run: npm run test:unit
- name: Run E2E tests
run: npm run test:e2e

View file

@ -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",