diff --git a/test/installation_node/install LTS b/test/installation_node/install LTS new file mode 100755 index 0000000..86aa33d --- /dev/null +++ b/test/installation_node/install LTS @@ -0,0 +1,31 @@ +#!/bin/sh + +set -ex + +die () { echo $@ ; exit 1; } + +. ../../nvm.sh + +nvm unalias default >/dev/null 2>&1 || die 'unable to unalias default' + +set +ex # needed for stderr +OUTPUT="$(nvm install --lts 3 2>&1)" +set -ex +EXIT_CODE="$(nvm install --lts 3 >/dev/null 2>&1 && echo $? || echo $?)" +EXPECTED_OUTPUT="Version '3' (with LTS filter) not found - try \`nvm ls-remote --lts\` to browse available versions." +[ "${EXIT_CODE}" = 3 ] || die "\`nvm install --lts 3\` did not exit with 3, got >${EXIT_CODE}<" +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "\`nvm install --lts 3\` output >${OUTPUT}<, expected >${EXPECTED_OUTPUT}<" + +set +ex # needed for stderr +OUTPUT="$(nvm install --lts=argon 3 2>&1)" +set -ex +EXIT_CODE="$(nvm install --lts=argon 3 >/dev/null 2>&1 && echo $? || echo $?)" +EXPECTED_OUTPUT="Version '3' (with LTS filter 'argon') not found - try \`nvm ls-remote --lts=argon\` to browse available versions." +[ "${EXIT_CODE}" = 3 ] || die "\`nvm install --lts=argon 3\` did not exit with 3, got >${EXIT_CODE}<" +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "\`nvm install --lts=argon 3\` output >${OUTPUT}<, expected >${EXPECTED_OUTPUT}<" + +set +e # TODO: fix +nvm install --lts 4.2.2 || die 'nvm install --lts 4.2.2 failed' +set -e + +[ "$(nvm current)" = "v4.2.2" ] || die "v4.2.2 not current, got $(nvm_current)" diff --git a/test/installation_node/teardown_dir b/test/installation_node/teardown_dir index 941ca99..a37d0e6 100755 --- a/test/installation_node/teardown_dir +++ b/test/installation_node/teardown_dir @@ -3,6 +3,7 @@ . ../../nvm.sh nvm deactivate nvm uninstall v0.10.7 +nvm uninstall v4.2.2 if [ -f ".nvmrc" ]; then rm .nvmrc