-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix]:
nvm ls
, nvm alias
, nvm install
: error when an LTS name i…
…s invalid
- Loading branch information
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
test/fast/Unit tests/nvm install with nonlowercase LTS name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
die () { echo "$@" ; exit 1; } | ||
|
||
\. ../../../nvm.sh | ||
|
||
REMOTE="${PWD}/mocks/nvm_ls_remote.txt" | ||
nvm_ls_remote() { | ||
cat "${REMOTE}" | ||
} | ||
REMOTE_IOJS="${PWD}/mocks/nvm_ls_remote_iojs.txt" | ||
nvm_ls_remote_iojs() { | ||
cat "${REMOTE_IOJS}" | ||
} | ||
ACTUAL="$(nvm install lts/ARGON 2>&1)" | ||
if [ $? -ne 3 ]; then | ||
die "Expected exit code of 3, got $?" | ||
fi | ||
|
||
EXPECTED='LTS names must be lowercase' | ||
|
||
[ "${ACTUAL}" = "${EXPECTED}" ] || die "Expected >${EXPECTED}<, got >${ACTUAL}<" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters