[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
Provenance
- Commit
71032cf- Tree
87b3f53- Author
Jordan Harband <ljharb@gmail.com>- Committer
Jordan Harband <ljharb@gmail.com>- Parent
6dd9ecb
2 files changed+7 added−5 removed
modified:test/slow/nvm reinstall-packages/Running "nvm copy-packages $(nvm ls current)" should error out+2 added
4 unmodified lines5 \. ../../../nvm.sh6 7 nvm use 0.10.28 > /dev/null8 9+nvm install-latest-npm || die 'nvm install-latest-npm failed'10+11 EXPECTED_MSG="Can not reinstall packages from the current version of node."12 ACTUAL_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 linesmodified:test/slow/nvm reinstall-packages/should work as expected+5 added-5 removed
2 unmodified lines3 die () { echo "$@" ; exit 1; }4 5 \. ../../../nvm.sh6 7-nvm 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 packages8-nvm 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 packages7+nvm 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 packages8+nvm 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 packages9 10 nvm use 0.10.2811 (cd test-npmlink && npm link)12 13-EXPECTED_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"13+EXPECTED_PACKAGES="autoprefixer bower david eslint grunt-cli grunth-cli http-server jshint marked node-gyp npmlist recursive-blame spawn-sync test-npmlink uglify-js"14 15-echo "$EXPECTED_PACKAGES" | sed -e 's/test-npmlink //' | xargs npm install -g --quiet15+echo "$EXPECTED_PACKAGES yo@1" | sed -e 's/test-npmlink //' | xargs npm install -g --quiet16 17 get_packages() {18 npm list -g --depth=0 | \sed -e '1 d' -e 's/^.* \(.*\)@.*/\1/' -e '/^npm$/ d' | xargs19 }3 unmodified lines23 24 nvm reinstall-packages 0.10.2825 FINAL_PACKAGES=$(get_packages)26 27-[ "$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)"29 30 [ $(test-npmlink) = 'ok' ] || die "failed to run test-npmlink"