diff options
author | isaacs <i@izs.me> | 2011-02-23 04:21:07 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-02-23 04:21:07 +0300 |
commit | 2e9aca8ec97c4f80dbee64caf1610d5366194bb1 (patch) | |
tree | 4727027208fda879f7145b8b2bb7f4d672e4927a /test | |
parent | 98701dd2002516dff3bc6381049009a8cb5fea5b (diff) |
Clean up tests a bit
Diffstat (limited to 'test')
-rwxr-xr-x | test/run.sh | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/test/run.sh b/test/run.sh index edb7ac8a5..c12ad6ccb 100755 --- a/test/run.sh +++ b/test/run.sh @@ -8,9 +8,6 @@ main () { # setup FAILURES=0 - # TODO: add more tests here. - # Run node programs by doing node some-thing.js - cd "$TESTDIR" # install @@ -33,7 +30,7 @@ main () { # used in test later npm config set package-config:foo boo || exit 1 - (cd packages/npm-test-bundletest && npm bundle || exit 1) || exit 1 + (cd packages/npm-test-bundletest && npm bundle) || exit 1 (ls packages | awk '{print "packages/" $1 }' | while read pkg; do npm link "$pkg" @@ -50,10 +47,24 @@ main () { npm install "$NPMPKG" || exit 1 (ls packages | grep -v 'npm-test-private' | while read pkg; do + if [ "$pkg" != "npm-test-bundletest" ]; then + (cd packages/$pkg ; npm bundle destroy) + fi npm publish packages/$pkg || exit 1 npm install $pkg || exit 1 npm unpublish $pkg || exit 1 done) || exit 1 + + # verify that the private package can't be published + # bypass the test-harness npm function. + "$NPMCLI" publish packages/npm-test-private && ( + npm unpublish npm-test-private + exit 1000 + ) + if [ $? -eq 1000 ]; then + fail "Private package shouldn't be publishable" >&2 + fi + if [ "$FAILURES" == "0" ]; then npm rm $(ls packages) npm || exit 1 fi @@ -78,13 +89,6 @@ npm () { echo -e "npm $@" "$NPMCLI" "$@" \ || fail npm "$@" - echo -n "" > output.log -} -node () { - local prog="$TESTDIR/$1" - $(which node) "$prog" &>output.log \ - || fail node "$@" - echo -n "" > output.log } # get the absolute path of the executable @@ -139,7 +143,6 @@ echo_err () { } fail () { let 'FAILURES += 1' - cat output.log echo_err "" echo_err -e "\033[33mFailure: $@\033[m" exit 1 |