From 9edc82b35434ca036ed42603884bfe5b7d16627c Mon Sep 17 00:00:00 2001 From: Evan Date: Fri, 18 Apr 2025 14:45:18 -0700 Subject: [PATCH] husky: run tests on commit --- .husky/pre-commit | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) mode change 100644 => 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit old mode 100644 new mode 100755 index 2312dc587..369c7b508 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,11 @@ -npx lint-staged +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +# Run tests first +npm run test || { + echo "Tests failed - commit aborted" + exit 1 +} + +# Then run lint-staged if tests pass +npx lint-staged \ No newline at end of file