Compare commits

..

2 Commits

Author SHA1 Message Date
Atsushi Yamamoto
9f520c97db
[Tests] nvm exec/nvm run: add --silent tests
Co-authored-by: Atsushi Yamamoto <yamaatsushi927@gmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2016-10-11 23:43:10 -07:00
Jordan Harband
e5521cfd3c
[actions] release test needs git tags 2025-02-04 08:44:48 -08:00
2 changed files with 9 additions and 5 deletions

View File

@ -19,6 +19,8 @@ jobs:
raw.githubusercontent.com:443 raw.githubusercontent.com:443
registry.npmjs.org:443 registry.npmjs.org:443
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
fetch-tags: true
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: "14" node-version: "14"

View File

@ -2,20 +2,22 @@
set -ex set -ex
die () { echo $@ ; exit 1; } die () { echo "$@" ; exit 1; }
. ../../../nvm.sh . ../../../nvm.sh
echo "0.10.7" > .nvmrc echo "0.10.7" > .nvmrc
# Check nvm run without --silent # Check nvm run without --silent
OUTPUT="$(nvm run --version | awk '{print $6}' | head -1)" OUTPUT="$(nvm run --version)"
EXPECTED_OUTPUT="<0.10.7>" EXPECTED_OUTPUT="Found '${PWD}/.nvmrc' with version <0.10.7>
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] \ Running node v0.10.7 (npm v1.2.21)
v0.10.7"
[ ">${OUTPUT}<" = ">${EXPECTED_OUTPUT}<" ] \
|| die "\`nvm run\` failed to run; did not match with the .nvmrc version; got >${OUTPUT}<" || die "\`nvm run\` failed to run; did not match with the .nvmrc version; got >${OUTPUT}<"
OUTPUT="$(nvm run --silent --version)" OUTPUT="$(nvm run --silent --version)"
EXPECTED_OUTPUT="" EXPECTED_OUTPUT="v0.10.7"
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] \ [ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] \
|| die "\`nvm run --silent\` failed to run silently; expected no output, got >${OUTPUT}<" || die "\`nvm run --silent\` failed to run silently; expected no output, got >${OUTPUT}<"