diff --git a/.claude/hooks/run-tests.sh b/.claude/hooks/run-tests.sh index 92aedf8..e2f368e 100755 --- a/.claude/hooks/run-tests.sh +++ b/.claude/hooks/run-tests.sh @@ -14,7 +14,7 @@ fi # Check for uncommitted changes in backend/frontend source HAS_BACKEND=$(git status --porcelain backend/src/ 2>/dev/null | head -1) -HAS_FRONTEND=$(git status --porcelain frontend/src/ 2>/dev/null | head -1) +HAS_FRONTEND=$(git status --porcelain frontend/src/ frontend/e2e/ 2>/dev/null | head -1) # Nothing changed -- skip if [[ -z "$HAS_BACKEND" && -z "$HAS_FRONTEND" ]]; then @@ -38,9 +38,15 @@ fi # Run frontend tests if TS/Vue sources changed if [[ -n "$HAS_FRONTEND" ]]; then if OUTPUT=$(cd frontend && npm run test:unit -- --run 2>&1); then - PASSED+="✓ Frontend tests passed. " + PASSED+="✓ Frontend unit tests passed. " else - ERRORS+="Frontend tests failed:\n$OUTPUT\n\n" + ERRORS+="Frontend unit tests failed:\n$OUTPUT\n\n" + fi + + if OUTPUT=$(cd frontend && npm run test:e2e 2>&1); then + PASSED+="✓ Frontend E2E tests passed. " + else + ERRORS+="Frontend E2E tests failed:\n$OUTPUT\n\n" fi fi diff --git a/README.md b/README.md index 9641ebd..2a360ae 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,11 @@ fete/ # Backend cd backend && ./mvnw test -# Frontend +# Frontend unit tests cd frontend && npm run test:unit + +# Frontend E2E tests (requires Chromium: npx playwright install chromium) +cd frontend && npm run test:e2e ``` ### Running the backend locally @@ -138,11 +141,12 @@ ArchUnit enforces hexagonal boundaries: domain must not depend on adapters, appl | TypeScript (strict) | `vue-tsc --noEmit` | Type errors | | oxlint + ESLint | `oxlint`, `eslint` | Lint violations | -**When the agent finishes** (Stop hook — only if `frontend/src/` has uncommitted changes): +**When the agent finishes** (Stop hook — only if `frontend/src/` or `frontend/e2e/` has uncommitted changes): | What | Command | Fails on | |---------------------|------------------------------|---------------------------------------| | Vitest | `npm run test:unit -- --run` | Test failures (fail-fast, stops at 1) | +| Playwright | `npm run test:e2e` | E2E test failures | **Not hooked** (run manually or via editor):