[Tests] set -ex options on more tests

Jordan Harband 2016-08-11 01:40:03 -07:00
parent d3d768adcd
commit 54cc3a383e
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
3 changed files with 20 additions and 6 deletions

View File

@ -1,23 +1,29 @@
#!/bin/sh
set -ex
die () { echo $@ ; exit 1; }
set +e # TODO: fix
. ../../nvm.sh
set -e
nvm deactivate || die 'deactivate failed'
nvm unalias default || die 'unable to unalias default'
NVM_TEST_VERSION=v0.10.7
# Remove the stuff we're clobbering.
[ -e ../../$NVM_TEST_VERSION ] && rm -R ../../$NVM_TEST_VERSION
nvm uninstall "${NVM_TEST_VERSION}" || die 'nvm uninstall failed'
# Install from source
nvm install -s $NVM_TEST_VERSION || die "'nvm install -s $NVM_TEST_VERSION' failed"
nvm install -s "${NVM_TEST_VERSION}" || die "'nvm install -s ${NVM_TEST_VERSION}' failed"
# Check
[ -d ../../$NVM_TEST_VERSION ]
nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION || "'nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION' failed"
[ -d ../../$NVM_TEST_VERSION ] || die "../../${NVM_TEST_VERSION} is not a directory"
nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION || "'nvm run ${NVM_TEST_VERSION} --version | grep ${NVM_TEST_VERSION}' failed"
# ensure default is set
NVM_CURRENT_DEFAULT="$(nvm_alias default)"
[ "$NVM_CURRENT_DEFAULT" = "$NVM_TEST_VERSION" ] || die "wrong default alias: $(nvm alias)"
[ "${NVM_CURRENT_DEFAULT}" = "${NVM_TEST_VERSION}" ] || die "wrong default alias: $(nvm alias)"

View File

@ -1,13 +1,19 @@
#!/bin/sh
set -ex
die () { echo $@ ; exit 1; }
set +e # TODO: fix
. ../../nvm.sh
set -e
nvm deactivate || die 'deactivate failed'
NVM_TEST_VERSION=v0.8.5
# Remove the stuff we're clobbering.
[ -e ../../$NVM_TEST_VERSION ] && rm -R ../../$NVM_TEST_VERSION
nvm uninstall "${NVM_TEST_VERSION}" || die 'uninstall failed'
# Install from source implicitly (v0.8.6 is when binaries started)
nvm install $NVM_TEST_VERSION || die "'nvm install -s $NVM_TEST_VERSION' failed"

View File

@ -1,5 +1,7 @@
#!/bin/sh
set -ex
die () { echo $@ ; exit 1; }
. ../../nvm.sh