mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 14:21:50 +00:00
Adding nvm exec tests.
This commit is contained in:
parent
d5c0e94166
commit
1fa2acf5a7
13
test/slow/nvm exec/Running "nvm exec 0.x" should work
Executable file
13
test/slow/nvm exec/Running "nvm exec 0.x" should work
Executable 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"
|
||||
|
17
test/slow/nvm exec/Running "nvm exec" should pick up .nvmrc version
Executable file
17
test/slow/nvm exec/Running "nvm exec" should pick up .nvmrc version
Executable 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"
|
||||
|
10
test/slow/nvm exec/setup_dir
Executable file
10
test/slow/nvm exec/setup_dir
Executable 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
|
||||
|
12
test/slow/nvm exec/teardown_dir
Executable file
12
test/slow/nvm exec/teardown_dir
Executable 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
|
||||
|
Loading…
Reference in New Issue
Block a user