We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91327e3 commit 4f75e34Copy full SHA for 4f75e34
1 file changed
.claude/hooks/format-and-lint.sh
@@ -13,3 +13,15 @@ fi
13
14
npx oxfmt "$FILE_PATH" >&2 || true
15
npx oxlint --type-aware --type-check "$FILE_PATH" >&2 || true
16
+
17
+# Run matching test file if it exists
18
+# Map frontend/src/ts/<path>/<file>.ts(x) -> frontend/__tests__/<path>/<file>.spec.ts(x)
19
+if [[ "$FILE_PATH" == frontend/src/ts/* ]]; then
20
+ REL="${FILE_PATH#frontend/src/ts/}"
21
+ BASE="${REL%.*}"
22
+ EXT="${REL##*.}"
23
+ TEST_FILE="frontend/__tests__/${BASE}.spec.${EXT}"
24
+ if [[ -f "$TEST_FILE" ]]; then
25
+ npx vitest run "$TEST_FILE" >&2 || true
26
+ fi
27
+fi
0 commit comments