mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-09-27 03:51:34 +00:00
[Fix] nvm install -b
: when no binary is available, fail and output a clear message
This commit is contained in:
16
test/fast/Unit tests/nvm install -b
Executable file
16
test/fast/Unit tests/nvm install -b
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
die () { echo "$@" ; exit 1; }
|
||||
|
||||
\. ../../../nvm.sh
|
||||
|
||||
VERSION="0.7.0"
|
||||
|
||||
EXIT_CODE=$(nvm install -b "${VERSION}" ; echo $?)
|
||||
|
||||
[ $EXIT_CODE -eq 3 ] || die "Expected exit code 3, got ${EXIT_CODE}"
|
||||
|
||||
ACTUAL="$(nvm install -b "${VERSION}" 2>&1)"
|
||||
EXPECTED="Binary download is not available for v${VERSION}"
|
||||
|
||||
[ "${ACTUAL}" = "${EXPECTED}" ] || die "Expected >${EXPECTED}<, got >${ACTUAL}<"
|
Reference in New Issue
Block a user