This commit is contained in:
Regular → Executable
+20
-1
@@ -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[@]}"
|
||||||
Reference in New Issue
Block a user