Fix unit test discovery
Template tests / tests (push) Successful in 1m58s

This commit is contained in:
Iisyourdad
2026-06-11 09:13:39 -05:00
parent f5e7e18fa4
commit 5aefbdacaa
+20 -1
View File
@@ -7,4 +7,23 @@ set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd "$ROOT_DIR" cd "$ROOT_DIR"
node --test tests/unit/ if [[ ! -d "tests/unit" ]]; then
echo "No tests/unit directory found, skipping unit tests."
exit 0
fi
mapfile -t unit_tests < <(find tests/unit -type f \( \
-name "*.test.js" -o \
-name "*.spec.js" -o \
-name "*.test.mjs" -o \
-name "*.spec.mjs" -o \
-name "*.test.cjs" -o \
-name "*.spec.cjs" \
\) | sort)
if [[ "${#unit_tests[@]}" -eq 0 ]]; then
echo "No unit test files found under tests/unit, skipping unit tests."
exit 0
fi
node --test "${unit_tests[@]}"