Files
Mana-Loop/.husky/scripts/run-tests.sh
T
n8n-gitea 2432f807be
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m58s
chore: add test runner to pre-commit hook with failure-only output
2026-05-31 01:42:34 +02:00

25 lines
803 B
Bash
Executable File

#!/bin/sh
# Run all tests and display only failing tests (plus a summary).
# Keeps output focused so commit context isn't bloated.
#
# NOTE: It doesn't matter if you didn't introduce the failing tests —
# they should be handled before committing. A red main branch helps no one.
cd "$(dirname "$0")/../.."
echo "🧪 Running tests (only failures will be shown)..."
# Disable TTY progress bars for clean pre-commit output.
# Use `--reporter=default` which prints only failures + the final summary.
CI=true npx vitest run --reporter=default 2>&1
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo ""
echo "⛔ Commit blocked: failing tests found."
echo " It doesn't matter if you didn't introduce the failing tests —"
echo " they should be handled before committing."
fi
exit $EXIT_CODE