#!/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