Skip to content
Myr

[Tests] update to latest npm in this test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jordan Harband · committed by Jordan Harband · parent 6dd9ecb · Browse files · 2 files+7 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+7 added−5 removed

  • tests:+7 added−5 removed

2 files+7 added−5 removed

modified:test/slow/nvm reinstall-packages/Running "nvm copy-packages $(nvm ls current)" should error out+2 added
4 unmodified lines
5\. ../../../nvm.sh67nvm use 0.10.28 > /dev/null89nvm install-latest-npm || die 'nvm install-latest-npm failed'1011EXPECTED_MSG="Can not reinstall packages from the current version of node."12ACTUAL_MSG="$(nvm reinstall-packages 0.10.28 2>&1 > /dev/null)"13[ "~$ACTUAL_MSG" = "~$EXPECTED_MSG" ] || die "'nvm use 0.10.28 && nvm reinstall-packages 0.10.28' did not fail with the right message: '$ACTUAL_MESSAGE'"14
4 unmodified lines
modified:test/slow/nvm reinstall-packages/should work as expected+5 added-5 removed
2 unmodified lines
3die () { echo "$@" ; exit 1; }45\. ../../../nvm.sh67nvm exec 0.10.28 npm install -g npm@~1.4.11 # this is required because before 1.4.10, npm ls doesn't indicated linked packages8nvm exec 0.10.29 npm install -g npm@~1.4.11 # this is required because before 1.4.10, npm ls doesn't indicated linked packages7nvm exec 0.10.28 npm install -g npm@~1.4.11 && nvm install-latest-npm # this is required because before 1.4.10, npm ls doesn't indicated linked packages8nvm exec 0.10.29 npm install -g npm@~1.4.11 && nvm install-latest-npm # this is required because before 1.4.10, npm ls doesn't indicated linked packages910nvm use 0.10.2811(cd test-npmlink && npm link)1213EXPECTED_PACKAGES="autoprefixer bower david eslint grunt-cli grunth-cli http-server jshint marked node-gyp npmlist recursive-blame spawn-sync test-npmlink uglify-js yo"13EXPECTED_PACKAGES="autoprefixer bower david eslint grunt-cli grunth-cli http-server jshint marked node-gyp npmlist recursive-blame spawn-sync test-npmlink uglify-js"1415echo "$EXPECTED_PACKAGES" | sed -e 's/test-npmlink //' | xargs npm install -g --quiet15echo "$EXPECTED_PACKAGES yo@1" | sed -e 's/test-npmlink //' | xargs npm install -g --quiet1617get_packages() {18 npm list -g --depth=0 | \sed -e '1 d' -e 's/^.* \(.*\)@.*/\1/' -e '/^npm$/ d' | xargs19}
3 unmodified lines
2324nvm reinstall-packages 0.10.2825FINAL_PACKAGES=$(get_packages)2627[ "$FINAL_PACKAGES" = "$EXPECTED_PACKAGES" ] || die "final packages ($FINAL_PACKAGES) did not match expected packages ($EXPECTED_PACKAGES)"27[ "$FINAL_PACKAGES" = "$EXPECTED_PACKAGES yo" ] || die "final packages ($FINAL_PACKAGES) did not match expected packages ($EXPECTED_PACKAGES)"28[ "$ORIGINAL_PACKAGES" != "$FINAL_PACKAGES" ] || die "original packages matched final packages ($ORIGINAL_PACKAGES)"2930[ $(test-npmlink) = 'ok' ] || die "failed to run test-npmlink"