Created
May 12, 2025 09:17
-
-
Save caugner/1b7d592d08d4d5b0963be8c2330b60b1 to your computer and use it in GitHub Desktop.
Test all deno versions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
if [[ -z "$1" ]]; then | |
echo "Usage: $0 <test> [<expected>]" | |
exit 1 | |
fi | |
test=$1; | |
expected=$2; | |
# List of Deno versions to test | |
versions=( | |
1.6.0 | |
1.7.0 | |
1.8.0 | |
1.9.0 | |
1.10.0 | |
1.11.0 | |
1.12.0 | |
1.13.0 | |
1.14.0 | |
1.15.0 | |
1.16.0 | |
1.17.0 | |
1.18.0 | |
1.19.0 | |
1.21.0 | |
1.22.0 | |
1.23.0 | |
1.24.0 | |
1.25.0 | |
1.26.0 | |
1.27.0 | |
1.28.0 | |
1.29.0 | |
1.30.0 | |
1.31.0 | |
1.32.0 | |
1.33.0 | |
1.34.0 | |
1.35.0 | |
1.36.0 | |
1.37.0 | |
1.38.0 | |
1.39.0 | |
1.40.0 | |
1.41.0 | |
1.42.0 | |
1.43.0 | |
1.44.0 | |
1.45.0 | |
1.46.0 | |
2.0.0 | |
2.1.0 | |
2.2.0 | |
) | |
echo "Test: $test" | |
if [[ -n "$expected" ]]; then | |
echo "Expected: $expected" | |
fi | |
for version in "${versions[@]}"; do | |
printf "Deno $version: " | |
dvm use $version >/dev/null | |
output=$(deno eval "console.log($test)" 2>/dev/null) | |
# Strip whitespace | |
actual=$(echo "$output" | tr -d '\n\r') | |
if [[ -z "$expected" ]]; then | |
echo "$actual" | |
elif [[ "$actual" == "$expected" ]]; then | |
echo "✅ $actual" | |
break | |
else | |
echo "❌ $actual" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment