refactored test suite g1 to bun

This commit is contained in:
John Yeo
2025-10-22 22:03:52 +01:00
parent b653f46798
commit 6d325cc7a4
60 changed files with 2516 additions and 1388 deletions

41
scripts/testGroups/config.sh Executable file
View File

@@ -0,0 +1,41 @@
#!/bin/bash
# Shared configuration for test groups
# Get project root directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
SERVER_DIR="$PROJECT_ROOT/server"
# Find bun executable (check common locations)
if command -v bun &> /dev/null; then
BUN_CMD="bun"
elif [ -f "$HOME/.bun/bin/bun" ]; then
BUN_CMD="$HOME/.bun/bin/bun"
elif [ -f "/usr/local/bin/bun" ]; then
BUN_CMD="/usr/local/bin/bun"
else
echo "Error: bun not found. Please install bun or add it to PATH."
exit 1
fi
# Test runner function
BUN_PARALLEL() {
cd "$PROJECT_ROOT" && $BUN_CMD scripts/testScripts/runTests.ts "$@"
}
# Test runner with compact mode (recommended for many tests)
BUN_PARALLEL_COMPACT() {
cd "$PROJECT_ROOT" && $BUN_CMD scripts/testScripts/runTests.ts "$@" --compact
}
# Setup function
BUN_SETUP() {
cd "$SERVER_DIR" && $BUN_CMD tests/setupMain.ts
}
# Mocha function (for tests not yet migrated)
MOCHA_CMD() {
cd "$SERVER_DIR" && npx mocha --parallel -j 6 --timeout 10000000 --ignore tests/00_setup.ts "$@"
}