diff --git a/scripts/run-tests-in-container.sh b/scripts/run-tests-in-container.sh new file mode 100755 index 0000000..b3f5a1f --- /dev/null +++ b/scripts/run-tests-in-container.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Run tests in a Node.js container (for consistent environment) + +set -e + +echo "Running tests in node:20-alpine container..." +echo "This avoids Node.js setup time and ensures consistent environment." +echo "" + +# Run unit tests in container +docker run --rm \ + -v "$(pwd):/app" \ + -w /app \ + node:20-alpine \ + sh -c "apk add --no-cache bash git && npm ci && npm run test:run"