#!/bin/bash set -e INCLUDE_INTEGRATION=false if [[ "$1" == "--integration" ]]; then INCLUDE_INTEGRATION=true fi echo "๐Ÿ” Finding test files..." if [ "$INCLUDE_INTEGRATION" = true ]; then TEST_FILES=$(find . -name "*.test.ts" -not -path "*/node_modules/*") else TEST_FILES=$(find . -name "*.test.ts" -not -name "*.integration.test.ts" -not -path "*/node_modules/*") fi if [ -z "$TEST_FILES" ]; then echo "โš ๏ธ No test files found!" exit 0 fi echo "๐Ÿงช Running tests sequentially..." if [ "$INCLUDE_INTEGRATION" = true ]; then echo " (including integration tests)" fi FAILED=0 for FILE in $TEST_FILES; do echo "---------------------------------------------------" echo "running: $FILE" if bun test "$FILE"; then echo "โœ… passed: $FILE" else echo "โŒ failed: $FILE" FAILED=1 # Fail fast exit 1 fi done if [ $FAILED -eq 0 ]; then echo "---------------------------------------------------" echo "โœ… All tests passed!" exit 0 else echo "---------------------------------------------------" echo "โŒ Some tests failed." exit 1 fi