Add test cases for optional version parameter positioning.

This commit is contained in:
Bickel, Korbin 2018-12-13 15:45:43 -05:00
parent 3a242147de
commit 81248bca38

View File

@ -0,0 +1,22 @@
#!/bin/sh
die () { echo "$@" ; exit 1; }
\. ../../nvm.sh
NVM_TEST_VERSION=v0.10.7
# Remove the stuff we're clobbering.
remove_install () { [ -e ../../$NVM_TEST_VERSION ] && rm -R ../../$NVM_TEST_VERSION }
# Install with version param first
remove_install
nvm install $NVM_TEST_VERSION --no-progress || die "install $NVM_TEST_VERSION failed with version param as first parameter"
# Install with version param last
remove_install
nvm install --no-progress $NVM_TEST_VERSION || die "install $NVM_TEST_VERSION failed with version param as last parameter"
# Install with version param between config parameters
remove_install
nvm install --skip-default-packages $NVM_TEST_VERSION --no-progress || die "install $NVM_TEST_VERSION failed with version param between config parameters"