nvm/test/fast/Running 'nvm-exec' should display required node version
Stiliyan Tonev (Bark) 59b40b8ae7 Rookie mistake from my side, forgot to clean-up the nvmrc, which caused other tests to fail.
Updated version color printing test because it did not pass.
2024-07-31 16:42:03 +03:00

20 lines
451 B
Bash
Executable File

#!/bin/bash
set -x
\. ../../nvm.sh
NVM_TEST_VERSION=v0.42
# Write it to nvmrc
echo "$NVM_TEST_VERSION" > .nvmrc
OUTPUT="$(../../nvm-exec 2>&1)";
EXPECTED="N/A: version \"${NVM_TEST_VERSION}\" is not yet installed.
You need to run \`nvm install ${NVM_TEST_VERSION}\` to install and use it.
No NODE_VERSION provided; no .nvmrc file found";
# Skip install, we want to test the error message
diff <(echo "${EXPECTED}") <(echo "${OUTPUT}")
rm .nvmrc