Adding nvm exec tests.

master
Jordan Harband 2014-08-02 15:36:45 -07:00
parent d5c0e94166
commit 1fa2acf5a7
4 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#!/bin/sh
die () { echo $@ ; exit 1; }
. ../../../nvm.sh
nvm use 0.10
NPM_VERSION_TEN="$(npm --version)"
nvm use 0.11.7 && [ "$(node --version)" = "v0.11.7" ] || die "\`nvm use\` failed!"
[ "$(nvm exec 0.10 npm --version | tail -1)" = "$NPM_VERSION_TEN" ] || die "`nvm exec` failed to run with the correct version"

View File

@ -0,0 +1,17 @@
#!/bin/sh
die () { echo $@ ; exit 1; }
. ../../../nvm.sh
nvm use 0.10.7
NPM_VERSION_TEN="$(npm --version)"
nvm use 0.11.7 && [ "$(node --version)" = "v0.11.7" ] || die "\`nvm use\` failed!"
echo "0.10.7" > .nvmrc
[ "$(nvm exec npm --version | tail -1)" = "$NPM_VERSION_TEN" ] || die "\`nvm exec\` failed to run with the .nvmrc version"
[ "$(nvm exec npm --version | head -1)" = "Found '$PWD/.nvmrc' with version <0.10.7>" ] || die "\`nvm exec\` failed to print out the \"found in .nvmrc\" message"

View File

@ -0,0 +1,10 @@
#!/bin/sh
. ../../../nvm.sh
nvm install 0.10.7
nvm install 0.11.7
if [ -f ".nvmrc" ]; then
mv .nvmrc .nvmrc.bak
fi

View File

@ -0,0 +1,12 @@
#!/bin/sh
. ../../../nvm.sh
nvm uninstall v0.10.7
nvm uninstall v0.11.7
rm .nvmrc
if [ -f ".nvmrc.bak" ]; then
mv .nvmrc.bak .nvmrc
fi