Skip to content

Commit be18696

Browse files
committed
fix test
1 parent 4cdbdae commit be18696

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

nvm.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2112,7 +2112,7 @@ nvm_die_on_prefix() {
21122112
if [ -f "${npmrc}/.npmrc" ]; then
21132113
NVM_NPM_PREFIX=$(grep ^prefix= "${npmrc}"/.npmrc | sed s/prefix=\\\(.*\\\)$/\\1/)
21142114
if ! [ -z "$NVM_NPM_PREFIX" ]; then
2115-
nvm_err "Incompatible prefix setting prefix=${npmrc} found in the config file ${npmrc}/.npmrc"
2115+
nvm_err "Incompatible prefix setting prefix=${NVM_NPM_PREFIX} found in the config file ${npmrc}/.npmrc"
21162116
break
21172117
fi
21182118
fi

test/fast/Unit tests/.npmrc

Whitespace-only changes.

test/fast/Unit tests/nvm_die_on_prefix

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ sed() {
6363
echo "./bad prefix"
6464
}
6565
OUTPUT="$(nvm_die_on_prefix 0 foo 2>&1)"
66-
EXPECTED_OUTPUT="nvm is not compatible with the npm config \"prefix\" option: currently set to \"./bad prefix\"
66+
EXPECTED_OUTPUT="Incompatible prefix setting prefix=./bad prefix found in the config file ./.npmrc
67+
nvm is not compatible with the npm config \"prefix\" option: currently set to \"./bad prefix\"
6768
Run \`npm config delete prefix\` or \`foo\` to unset it."
6869
EXIT_CODE="$(nvm_die_on_prefix 0 foo >/dev/null 2>&1; echo $?)"
6970
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "'nvm_die_on_prefix 0 foo' did not error with '$EXPECTED_OUTPUT' with bad prefix set; got '$OUTPUT'"

0 commit comments

Comments
 (0)