← Back
#!/bin/bash
# Pre-commit hook — runs tests before allowing commit
# Install: cp scripts/pre-commit.sh .git/hooks/pre-commit

set -eo pipefail

echo "[pre-commit] Running tests..."
npm test --silent 2>&1

if [ $? -ne 0 ]; then
  echo ""
  echo "[pre-commit] FAILED: Tests did not pass. Commit aborted."
  echo "  Run 'npm test' to see details."
  exit 1
fi

echo "[pre-commit] All tests passed."

📜 Git History

b873b03feat: add deploy/ops scripts, vitest config, and expanded test suite9 weeks ago
Show last diff
Loading...