Skip to content

Commit

Permalink
[Fix] ls-remote: do not match on bare LTS names, eg Argon
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Feb 4, 2025
1 parent 9f520c9 commit 5923e33
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/fast/Unit tests/nvm ls-remote
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,11 @@ OUTPUT="$(nvm ls-remote | sed 's/[ \t]*$//')"
EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}" | sed 's/[ \t]*$//' )"
[ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] || die "bare nvm ls-remote did not output expected sorted versions; got >${OUTPUT}< expected >${EXPECTED_OUTPUT}<"

OUTPUT="$(nvm ls-remote Argon 2>&1)"
EXIT_CODE=$?
[ $EXIT_CODE -eq 3 ] || die "nvm ls-remote Argon did not exit 3, got '${EXIT_CODE}'"

EXPECTED_OUTPUT=" N/A"
[ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] || die "nvm ls-remote Argon did not output expected error message; got >${OUTPUT}< expected >${EXPECTED_OUTPUT}<"

cleanup

0 comments on commit 5923e33

Please sign in to comment.