Skip to content
Myr

[Tests] ensure `nvm unload` unsets env vars too

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jordan Harband · committed by Jordan Harband · parent a1ad32e · Browse files · 1 file+2 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−0 removed

  • tests:+2 added−0 removed

1 file+2 added−0 removed

modified:test/fast/Running "nvm unload" should unset all function and variables.+2 added
7 unmodified lines
8cleanup () { rm -f "${BEFORE}" "${AFTER}"; }9die () { echo "$@" ; cleanup ; exit 1; }1011typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${BEFORE}"12env | grep -v PATH= | grep -v NVM_ >> "${BEFORE}"1314set +e # TODO: fix15\. ../../nvm.sh16set -e
2 unmodified lines
1920nvm unload2122typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${AFTER}"23env | grep -v PATH= >> "${AFTER}"2425! type nvm > /dev/null 2>&1 || die "nvm not unloaded"2627DIFF="$(diff "${BEFORE}" "${AFTER}" ||:)"
3 unmodified lines