Merge pull request #523 from creationix/run_slow_nvmrc_tests_too
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Actually run all tests; fix some bugs
authored by Jordan Harband · committed by Jordan Harband · parents f6fef75, 3d3145f · Browse files · 6 files·+19 added−12 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+19 added−12 removed
- tests:+12 added−8 removed
- other:+7 added−4 removed
Provenance
- Commit
7bb6e9c- Tree
c282c5e- Author
Jordan Harband <ljharb@gmail.com>- Committer
Jordan Harband <ljharb@gmail.com>- Parent 1
f6fef75- Parent 2
3d3145f
6 files changed+19 added−12 removed
modified:test/fast/Listing versions/teardown
modified:test/fast/Running "nvm use x" should not create the "current" symlink if $NVM_SYMLINK_CURRENT is false+1 added-1 removed
32 unmodified lines33 }34 35 function runNvmUse() {36 mkdir ../../${TEST_NODE_VERSION}37- nvm use ${TEST_NODE_VERSION} &> /dev/null37+ nvm use ${TEST_NODE_VERSION} > /dev/null 2>&138 rmdir ../../${TEST_NODE_VERSION}39 }40 41 function isCurrentSymlinkPresent() {42 unmodified linesmodified:test/slow/nvm copy-packages/Running "nvm copy-packages $(nvm ls current)" should error out+9 added-5 removed
1 #!/bin/sh2 3 die () { echo $@ ; exit 1; }4 5-. ../../nvm.sh5+. ../../../nvm.sh6 7-local EXPECTED_MSG="Can not copy packages from the current version of node."8-[ "$(nvm use 0.10.28 && nvm copy-packages 0.10.28 2&>1)" = "$EXPECTED_MSG" ] || die '"nvm use 0.10.28 && nvm copy-packages 0.10.28" did not fail with the right message'7+nvm use 0.10.28 > /dev/null8 10-$(nvm use 0.10.28 && nvm copy-packages 0.10.28)11-[ $? = 2 ] || die '"nvm use 0.10.28 && nvm copy-packages 0.10.28" did not fail with the right error code'9+EXPECTED_MSG="Can not copy packages from the current version of node."10+ACTUAL_MSG="$(nvm copy-packages 0.10.28 2>&1 > /dev/null)"11+[ "~$ACTUAL_MSG" = "~$EXPECTED_MSG" ] || die "'nvm use 0.10.28 && nvm copy-packages 0.10.28' did not fail with the right message: '$ACTUAL_MESSAGE'"12 13+EXPECTED_ERROR_CODE="2"14+ACTUAL_ERROR_CODE="$(nvm copy-packages 0.10.28 > /dev/null 2>&1 ; echo $?)"15+[ "~$ACTUAL_ERROR_CODE" = "~$EXPECTED_ERROR_CODE" ] || die "'nvm use 0.10.28 && nvm copy-packages 0.10.28' did not fail with the right error code: expected '$EXPECTED_ERROR_CODE', got '$ACTUAL_ERROR_CODE'"16+modified:test/slow/nvm install/install version specified in .nvmrc from binary+1 added-1 removed
7 unmodified lines8 # Remove the stuff we're clobbering.9 [ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION10 11 # Install from binary12-cat "$NVM_TEST_VERSION" > .nvmrc12+echo "$NVM_TEST_VERSION" > .nvmrc13 14 nvm install15 16 # Check4 unmodified linesmodified:test/slow/nvm install/install version specified in .nvmrc from source+1 added-1 removed
7 unmodified lines8 # Remove the stuff we're clobbering.9 [ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION10 11 # Install from binary12-cat "$NVM_TEST_VERSION" > .nvmrc12+echo "$NVM_TEST_VERSION" > .nvmrc13 14 nvm install -s15 16 # Check4 unmodified linesmodified:nvm.sh+7 added-4 removed
431 unmodified lines432 nobinary=1433 fi434 435 provided_version=$1436+437 if [ -z "$provided_version" ]; then438 if [ $version_not_provided -ne 1 ]; then439 nvm_rc_version440 fi441 provided_version="$NVM_RC_VERSION"442+ else443+ shift444 fi445 [ -d "$(nvm_version_path "$provided_version")" ] && echo "$provided_version is already installed." >&2 && return446 447 VERSION=`nvm_remote_version $provided_version`448 ADDITIONAL_PARAMETERS=''449 447- shift448-450 while [ $# -ne 0 ]451 do452 ADDITIONAL_PARAMETERS="$ADDITIONAL_PARAMETERS $1"453 shift40 unmodified lines494 fi495 fi496 fi497 498+ if [ -n "$ADDITIONAL_PARAMETERS" ]; then497- echo "Additional options while compiling: $ADDITIONAL_PARAMETERS"499+ echo "Additional options while compiling: $ADDITIONAL_PARAMETERS"500+ fi501 502 tarball=''503 sum=''504 make='make'293 unmodified lines798 799 local PROVIDED_VERSION800 PROVIDED_VERSION="$2"801 799- if [ "$PROVIDED_VERSION" = "$(nvm_ls_current)" ]; then802+ if [ "$PROVIDED_VERSION" = "$(nvm_ls_current)" ] || [ "$(nvm_version $PROVIDED_VERSION)" = "$(nvm_ls_current)" ]; then803 echo 'Can not copy packages from the current version of node.' >&2804 return 2805 fi806 37 unmodified lines