implicit: implement Implicit 10.3 - add optional test check to pre-commit hook
- Added optional test check to pre-commit hook - Runs unit tests only (fast, not E2E) - Can be skipped with SKIP_TESTS=1 environment variable - Blocks commits with failing tests - Provides helpful error messages and tips - Keeps pre-commit hook fast by only running unit tests
This commit is contained in:
parent
dbb9fe58ff
commit
be06ce90f8
1 changed files with 12 additions and 0 deletions
|
|
@ -19,3 +19,15 @@ cd apps/web && npm run lint 2>&1 | grep -q "error" && {
|
||||||
echo "💡 Tip: Run 'npm run lint:fix' to automatically fix some issues."
|
echo "💡 Tip: Run 'npm run lint:fix' to automatically fix some issues."
|
||||||
exit 1
|
exit 1
|
||||||
} || true
|
} || true
|
||||||
|
|
||||||
|
# Implicit 10.3: Test checking (optional, fast unit tests only)
|
||||||
|
# Skip if SKIP_TESTS environment variable is set (for quick commits)
|
||||||
|
# Only runs unit tests (not E2E) to keep it fast
|
||||||
|
if [ -z "$SKIP_TESTS" ]; then
|
||||||
|
cd apps/web && npm test -- --run 2>&1 | grep -q "FAIL" && {
|
||||||
|
echo "❌ Tests failed. Please fix failing tests before committing."
|
||||||
|
echo "💡 Tip: Run 'npm test' to see all test failures."
|
||||||
|
echo "💡 Tip: Set SKIP_TESTS=1 to skip tests for this commit (not recommended)."
|
||||||
|
exit 1
|
||||||
|
} || true
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue