From e2e612e722ddb7addbbc9c7837b7975e69b71b81 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 2 Jul 2026 15:49:01 -0500 Subject: [PATCH] [Tests] `installation_node`: only match top-level global packages --- .../install while reinstalling packages | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/installation_node/install while reinstalling packages b/test/installation_node/install while reinstalling packages index 1e92ddb2..c1b56667 100755 --- a/test/installation_node/install while reinstalling packages +++ b/test/installation_node/install while reinstalling packages @@ -73,18 +73,18 @@ npm list --global | grep object-is > /dev/null || die "object-is isn't installed # install a fresh global package on the source (v9.7.0) only nvm use 9.7.0 npm install -g is-nan@1.0.1 || die "npm install -g is-nan failed" -npm list --global | grep is-nan > /dev/null || die "is-nan isn't installed on v9.7.0" +npm list --global --depth=0 | grep is-nan > /dev/null || die "is-nan isn't installed on v9.7.0" # precondition: the already-installed target (v9.10.0) must not have it yet nvm use 9.10.0 -npm list --global | grep is-nan > /dev/null && die "is-nan should not be installed on v9.10.0 before reinstall" +npm list --global --depth=0 | grep is-nan > /dev/null && die "is-nan should not be installed on v9.10.0 before reinstall" # target is already installed, so this should report so AND still migrate packages OUTPUT="$(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}" nvm_echo "${OUTPUT}" | grep "is already installed" > /dev/null || die "expected 'already installed' message, got: ${OUTPUT}" nvm use 9.10.0 -npm list --global | grep is-nan > /dev/null || die "is-nan was not migrated to already-installed v9.10.0" +npm list --global --depth=0 | grep is-nan > /dev/null || die "is-nan was not migrated to already-installed v9.10.0" # ...the same is true for default packages: they must install on the already-installed path too. @@ -99,11 +99,11 @@ nvm_echo 'object-inspect@1.0.2' > "${DEFAULT_PACKAGES_FILE}" # precondition: the already-installed target must not have the default package yet nvm use 9.10.0 -npm list --global | grep object-inspect > /dev/null && die "object-inspect should not be installed on v9.10.0 before default-packages test" +npm list --global --depth=0 | grep object-inspect > /dev/null && die "object-inspect should not be installed on v9.10.0 before default-packages test" nvm install 9.10.0 > /dev/null 2>&1 || die "nvm install 9.10.0 (already installed, default-packages) failed" nvm use 9.10.0 -npm list --global | grep object-inspect > /dev/null || die "default packages were not installed on already-installed v9.10.0" +npm list --global --depth=0 | grep object-inspect > /dev/null || die "default packages were not installed on already-installed v9.10.0" # restore the default-packages file before the next assertion cleanup