From 8685e802cda30f764f6ba89cd4a471791f2096e8 Mon Sep 17 00:00:00 2001 From: Daniel Volz Date: Sun, 25 Jan 2026 20:04:03 +0100 Subject: [PATCH] fix: add frontend tests to pre-push hook (#78) --- .husky/pre-push | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.husky/pre-push b/.husky/pre-push index fee035f..43e3db3 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,7 +1,11 @@ #!/bin/sh +# Get the directory where the script is located +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +ROOT_DIR="$(dirname "$SCRIPT_DIR")" + echo "Running backend tests before push..." -cd backend && CI=true npm test +cd "$ROOT_DIR/backend" && CI=true npm test if [ $? -ne 0 ]; then echo "❌ Backend tests failed. Push aborted." @@ -10,3 +14,18 @@ if [ $? -ne 0 ]; then fi echo "✅ Backend tests passed!" + +echo "" +echo "Running frontend tests before push..." +cd "$ROOT_DIR/frontend" && CI=true npm test + +if [ $? -ne 0 ]; then + echo "❌ Frontend tests failed. Push aborted." + echo "Use 'git push --no-verify' to skip tests if needed." + exit 1 +fi + +echo "✅ Frontend tests passed!" + +echo "" +echo "✅ All tests passed! Pushing..."