mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-10-31 01:45:50 +08:00
[Tests] fix broken tests exposed by 863bd63
Leaves 2 non-executable, + some TODOs
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
cleanup () {
|
||||
unset -f die cleanup NVM_AUTH_HEADER
|
||||
unset -f die cleanup
|
||||
docker stop httpbin && docker rm httpbin
|
||||
}
|
||||
die () { echo "$@" ; cleanup ; exit 1; }
|
||||
@@ -17,13 +17,12 @@ nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/install.sh" >/de
|
||||
! nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/wrong_install.sh" >/dev/null || die "nvm_download should fail to download no existing file"
|
||||
|
||||
# nvm_download should pass when calling with auth header
|
||||
docker pull kennethreitz/httpbin && docker run --shell=bash -d --name httpbin -p 80:80 kennethreitz/httpbin
|
||||
docker pull kennethreitz/httpbin && SHELL=bash docker run -d --name httpbin -p 80:80 kennethreitz/httpbin
|
||||
sleep 1 # wait for httpbin to start
|
||||
NVM_AUTH_HEADER="Bearer test-token" nvm_download "http://127.0.0.1/bearer" > /dev/null || die 'nvm_download with auth header should send correctly'
|
||||
|
||||
# nvm_download should fail when calling without auth header
|
||||
nvm_download "http://127.0.0.1/bearer" > /dev/null && die 'nvm_download with no auth header should not send the header and should fail'
|
||||
docker stop httpbin && docker rm httpbin
|
||||
|
||||
# ensure quoted extra args remain quoted
|
||||
nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/install.sh" -o "; die quoted-command-not-quoted" || die 'command failed'
|
||||
|
||||
Reference in New Issue
Block a user