[Tests] try to make `nvm unload` test more robust
parent
6c560b12b6
commit
4cd6b4822c
|
@ -5,11 +5,11 @@ set -ex
|
||||||
BEFORE="./before.tmp"
|
BEFORE="./before.tmp"
|
||||||
AFTER="./after.tmp"
|
AFTER="./after.tmp"
|
||||||
|
|
||||||
cleanup () { rm -f "${BEFORE}" "${AFTER}"; }
|
cleanup () { echo rm -f "${BEFORE}" "${AFTER}"; }
|
||||||
die () { echo "$@" ; cleanup ; exit 1; }
|
die () { echo "$@" ; cleanup ; exit 1; }
|
||||||
|
|
||||||
typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${BEFORE}"
|
typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${BEFORE}"
|
||||||
env | grep -v PATH= | grep -v NVM_ >> "${BEFORE}"
|
env | grep -v PATH= | grep -v IFS= | grep -v NVM_ | sort >> "${BEFORE}"
|
||||||
|
|
||||||
set +e # TODO: fix
|
set +e # TODO: fix
|
||||||
\. ../../nvm.sh
|
\. ../../nvm.sh
|
||||||
|
@ -20,7 +20,7 @@ type nvm > /dev/null 2>&1 || die "nvm not loaded"
|
||||||
nvm unload
|
nvm unload
|
||||||
|
|
||||||
typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${AFTER}"
|
typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${AFTER}"
|
||||||
env | grep -v PATH= >> "${AFTER}"
|
env | grep -v PATH= | grep -v IFS= | sort >> "${AFTER}"
|
||||||
|
|
||||||
! type nvm > /dev/null 2>&1 || die "nvm not unloaded"
|
! type nvm > /dev/null 2>&1 || die "nvm not unloaded"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue