Skip to content
Myr

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

6 files+19 added−12 removed

modified:test/fast/Listing versions/teardown
modified:test/slow/nvm copy-packages/Running "nvm copy-packages $(nvm ls current)" should error out+9 added-5 removed
1#!/bin/sh23die () { echo $@ ; exit 1; }45. ../../nvm.sh5. ../../../nvm.sh67local 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'7nvm use 0.10.28 > /dev/null810$(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'9EXPECTED_MSG="Can not copy packages from the current version of node."10ACTUAL_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'"1213EXPECTED_ERROR_CODE="2"14ACTUAL_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 lines
8# Remove the stuff we're clobbering.9[ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION1011# Install from binary12cat "$NVM_TEST_VERSION" > .nvmrc12echo "$NVM_TEST_VERSION" > .nvmrc1314nvm install1516# Check
4 unmodified lines
modified:test/slow/nvm install/install version specified in .nvmrc from source+1 added-1 removed
7 unmodified lines
8# Remove the stuff we're clobbering.9[ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION1011# Install from binary12cat "$NVM_TEST_VERSION" > .nvmrc12echo "$NVM_TEST_VERSION" > .nvmrc1314nvm install -s1516# Check
4 unmodified lines
modified:nvm.sh+7 added-4 removed
431 unmodified lines
432 nobinary=1433 fi434435 provided_version=$1436437 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 && return446447 VERSION=`nvm_remote_version $provided_version`448 ADDITIONAL_PARAMETERS=''449447 shift448450 while [ $# -ne 0 ]451 do452 ADDITIONAL_PARAMETERS="$ADDITIONAL_PARAMETERS $1"453 shift
40 unmodified lines
494 fi495 fi496 fi497498 if [ -n "$ADDITIONAL_PARAMETERS" ]; then497 echo "Additional options while compiling: $ADDITIONAL_PARAMETERS"499 echo "Additional options while compiling: $ADDITIONAL_PARAMETERS"500 fi501502 tarball=''503 sum=''504 make='make'
293 unmodified lines
798799 local PROVIDED_VERSION800 PROVIDED_VERSION="$2"801799 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