nvm/test/slow/nvm run/Running 'nvm run 0.x' should error out sensibly when 0.x is not installed
Ricky Bobby 06174ba58f commit
2024-03-19 15:27:10 +00:00

17 lines
602 B
Bash

#!/bin/sh
die () { echo "$@" ; exit 1; }
\. ../../../nvm.sh
EXPECTED_OUTPUT='N/A: version "v0.2" is not yet installed.
You need to run `nvm install 0.2` to install and use it.'
[ "_$(nvm run 0.2 --version 2>&1)" = "_$EXPECTED_OUTPUT" ] || die "\`nvm run\` with an uninstalled node version failed to error out correctly"
EXPECTED_OUTPUT='N/A: version "iojs-v0.2" is not yet installed.
You need to run `nvm install iojs-0.2` to install and use it.'
[ "_$(nvm run iojs-0.2 --version 2>&1)" = "_$EXPECTED_OUTPUT" ] || die "\`nvm run\` with an uninstalled iojs version failed to error out correctly"