Skip to content
Myr

[Tests] `installation_node`: only match top-level global packages

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 041a577 · Browse files · 1 file+5 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

1 file+5 added−5 removed

  • tests:+5 added−5 removed

1 file+5 added−5 removed

modified:test/installation_node/install while reinstalling packages+5 added-5 removed
71 unmodified lines
7273# install a fresh global package on the source (v9.7.0) only74nvm use 9.7.075npm install -g is-nan@1.0.1 || die "npm install -g is-nan failed"76npm list --global | grep is-nan > /dev/null || die "is-nan isn't installed on v9.7.0"76npm list --global --depth=0 | grep is-nan > /dev/null || die "is-nan isn't installed on v9.7.0"7778# precondition: the already-installed target (v9.10.0) must not have it yet79nvm use 9.10.080npm list --global | grep is-nan > /dev/null && die "is-nan should not be installed on v9.10.0 before reinstall"80npm list --global --depth=0 | grep is-nan > /dev/null && die "is-nan should not be installed on v9.10.0 before reinstall"8182# target is already installed, so this should report so AND still migrate packages83OUTPUT="$(nvm install --reinstall-packages-from=9.7.0 9.10.0 2>&1)" || die "nvm install --reinstall-packages-from=9.7.0 9.10.0 failed: ${OUTPUT}"84nvm_echo "${OUTPUT}" | grep "is already installed" > /dev/null || die "expected 'already installed' message, got: ${OUTPUT}"8586nvm use 9.10.087npm list --global | grep is-nan > /dev/null || die "is-nan was not migrated to already-installed v9.10.0"87npm list --global --depth=0 | grep is-nan > /dev/null || die "is-nan was not migrated to already-installed v9.10.0"888990# ...the same is true for default packages: they must install on the already-installed path too.91
6 unmodified lines
98nvm_echo 'object-inspect@1.0.2' > "${DEFAULT_PACKAGES_FILE}"99100# precondition: the already-installed target must not have the default package yet101nvm use 9.10.0102npm list --global | grep object-inspect > /dev/null && die "object-inspect should not be installed on v9.10.0 before default-packages test"102npm list --global --depth=0 | grep object-inspect > /dev/null && die "object-inspect should not be installed on v9.10.0 before default-packages test"103104nvm install 9.10.0 > /dev/null 2>&1 || die "nvm install 9.10.0 (already installed, default-packages) failed"105nvm use 9.10.0106npm list --global | grep object-inspect > /dev/null || die "default packages were not installed on already-installed v9.10.0"106npm list --global --depth=0 | grep object-inspect > /dev/null || die "default packages were not installed on already-installed v9.10.0"107108# restore the default-packages file before the next assertion109cleanup110
8 unmodified lines