modified: .forgejo/workflows/test.yml modified: package.json
This commit is contained in:
parent
8baba8a426
commit
f3bdec089b
3 changed files with 3 additions and 25 deletions
|
@ -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
|
|
|
@ -24,11 +24,8 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Set up Unit test script
|
|
||||||
run: chmod +x ./.forgejo/workflows/run-tests.sh
|
|
||||||
|
|
||||||
- name: Run Unit tests
|
- name: Run Unit tests
|
||||||
run: ./.forgejo/workflows/run-tests.sh
|
run: npm run test:unit
|
||||||
|
|
||||||
- name: Run E2E tests
|
- name: Run E2E tests
|
||||||
run: npm run test:e2e
|
run: npm run test:e2e
|
|
@ -7,7 +7,7 @@
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "run-p type-check \"build-only {@}\" --",
|
"build": "run-p type-check \"build-only {@}\" --",
|
||||||
"preview": "vite preview",
|
"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": "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'",
|
"test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'",
|
||||||
"build-only": "vite build",
|
"build-only": "vite build",
|
||||||
|
|
Loading…
Add table
Reference in a new issue