Skip to content

Commit

Permalink
[Tests] add some nvm_do_install tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Aug 6, 2023
1 parent b1a57c1 commit b89fd89
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/install_script/nvm_do_install
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ NVM_ENV=testing \. ../../install.sh

#nvm_do_install is available
type nvm_do_install > /dev/null 2>&1 || die 'nvm_do_install is not available'

FILE_PATH="$(pwd)/nvm_do_install"
EXIT_CODE=$(NVM_DIR="${FILE_PATH}" nvm_do_install; echo $?)
[ $EXIT_CODE -eq 1 ] || die 'nvm_do_install should fail if NVM_DIR is a file'

ACTUAL="$(NVM_DIR="${FILE_PATH}" nvm_do_install)"
EXPECTED="File \"${FILE_PATH}\" has the same name as installation directory."
[ "${ACTUAL}" = "${EXPECTED}" ] || die 'nvm_do_install should fail if NVM_DIR is a file'

0 comments on commit b89fd89

Please sign in to comment.