Mario Zechner 0c74907da2 [tests] Improve snapshot testing infrastructure
- test.sh which given a language builds the headless test executable and runs the test with the given inputs
- generate-serializers.sh to (re-)generate all language specific serializers
- Improved README.md
- Removed headless-test-runner.ts, now fully expressed in more concise test.sh
2025-07-15 15:13:45 +02:00

23 lines
594 B
Bash
Executable File

#!/bin/bash
# Change to the script's directory
cd "$(dirname "$0")"
# Check if node/npm is available
if ! command -v npm &> /dev/null; then
echo "Error: npm is not installed" >&2
exit 1
fi
# Install dependencies if node_modules doesn't exist
if [ ! -d "node_modules" ]; then
echo "Installing dependencies..." >&2
if ! npm install > /tmp/npm-install.log 2>&1; then
echo "npm install failed! Output:" >&2
cat /tmp/npm-install.log >&2
exit 1
fi
fi
# Run the TypeScript headless test runner with all arguments
npx tsx src/headless-test-runner.ts "$@"