From ce35311657b10f95826ff936d60ed018981986c8 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 27 Dec 2022 13:16:10 -0800 Subject: [PATCH] [Tests] force the NVM_DIR to the expected location, for tests --- test/fast/Aliases/setup | 2 ++ .../Running 'nvm ls' should not show a trailing slash | 2 ++ ...ning 'nvm alias' should create a file in the alias directory | 2 ++ ...Running 'nvm current' should display current nvm environment | 2 ++ ... 'nvm deactivate' should unset the nvm environment variables | 2 ++ ...l' with '--reinstall-packages-from' requires a valid version | 2 ++ .../Running 'nvm install' with an invalid version fails nicely | 2 ++ 7 files changed, 14 insertions(+) diff --git a/test/fast/Aliases/setup b/test/fast/Aliases/setup index 7055a4d..9b82259 100755 --- a/test/fast/Aliases/setup +++ b/test/fast/Aliases/setup @@ -1,5 +1,7 @@ #!/bin/sh +export NVM_DIR="$(cd ../../.. && pwd)" + \. ../../../nvm.sh \. ../../common.sh diff --git a/test/fast/Listing versions/Running 'nvm ls' should not show a trailing slash b/test/fast/Listing versions/Running 'nvm ls' should not show a trailing slash index 5173870..e3dbd5b 100755 --- a/test/fast/Listing versions/Running 'nvm ls' should not show a trailing slash +++ b/test/fast/Listing versions/Running 'nvm ls' should not show a trailing slash @@ -1,5 +1,7 @@ #!/bin/zsh +export NVM_DIR="$(cd ../../.. && pwd)" + \. ../../../nvm.sh \. ../../common.sh diff --git a/test/fast/Running 'nvm alias' should create a file in the alias directory b/test/fast/Running 'nvm alias' should create a file in the alias directory index 1ff49f5..c061a57 100755 --- a/test/fast/Running 'nvm alias' should create a file in the alias directory +++ b/test/fast/Running 'nvm alias' should create a file in the alias directory @@ -2,6 +2,8 @@ set -ex +export NVM_DIR="$(cd ../.. && pwd)" + \. ../../nvm.sh nvm alias test v0.1.2 diff --git a/test/fast/Running 'nvm current' should display current nvm environment b/test/fast/Running 'nvm current' should display current nvm environment index 1d4d19b..b9f1304 100755 --- a/test/fast/Running 'nvm current' should display current nvm environment +++ b/test/fast/Running 'nvm current' should display current nvm environment @@ -4,6 +4,8 @@ set -ex die () { echo "$@" ; exit 1; } +export NVM_DIR="$(cd ../.. && pwd)" + \. ../../nvm.sh nvm deactivate 2>&1 diff --git a/test/fast/Running 'nvm deactivate' should unset the nvm environment variables b/test/fast/Running 'nvm deactivate' should unset the nvm environment variables index 5cb5594..b631597 100755 --- a/test/fast/Running 'nvm deactivate' should unset the nvm environment variables +++ b/test/fast/Running 'nvm deactivate' should unset the nvm environment variables @@ -4,6 +4,8 @@ set -ex die () { echo "$@" ; exit 1; } +export NVM_DIR="$(cd ../.. && pwd)" + \. ../../nvm.sh \. ../common.sh diff --git a/test/fast/Running 'nvm install' with '--reinstall-packages-from' requires a valid version b/test/fast/Running 'nvm install' with '--reinstall-packages-from' requires a valid version index 41016da..329fe2b 100755 --- a/test/fast/Running 'nvm install' with '--reinstall-packages-from' requires a valid version +++ b/test/fast/Running 'nvm install' with '--reinstall-packages-from' requires a valid version @@ -7,6 +7,8 @@ cleanup () { rm -rf "${NVM_DIR}/v0.10.4" } +export NVM_DIR="$(cd ../.. && pwd)" + \. ../../nvm.sh \. ../common.sh diff --git a/test/fast/Running 'nvm install' with an invalid version fails nicely b/test/fast/Running 'nvm install' with an invalid version fails nicely index 6b28d6d..5bbea41 100755 --- a/test/fast/Running 'nvm install' with an invalid version fails nicely +++ b/test/fast/Running 'nvm install' with an invalid version fails nicely @@ -4,6 +4,8 @@ set -ex die () { echo "$@" ; exit 1; } +export NVM_DIR="$(cd ../.. && pwd)" + \. ../../nvm.sh set +ex # needed for stderr