Created
October 10, 2024 14:11
-
-
Save gabmontes/eebae5a370d3195561091901ace27b55 to your computer and use it in GitHub Desktop.
Simple Bash script to test a package with all Node.js 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
#!/bin/bash | |
set -e | |
# shellcheck disable=SC1091 | |
. "$NVM_DIR/nvm.sh" | |
test_node_version() { | |
VERSION=$1 | |
echo "Testing Node $VERSION -------------------------------------------------" | |
nvm use "$VERSION" | |
rm -rf package-lock.json node_modules | |
npm i | |
npm test | |
} | |
VERSIONS=("22" "20" "18" "16" "14" "12" "10" "8" "6" "4" "0.12") | |
for VERSION in "${VERSIONS[@]}"; do | |
test_node_version "$VERSION" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment