chore: make test command cleanup after itself and fail early for style errors

This commit is contained in:
Stephan Bönnemann 2015-04-04 15:32:21 +02:00
parent 6763a006d2
commit d4f6ee0d6a
3 changed files with 22 additions and 13 deletions

View File

@ -1,9 +0,0 @@
#!/bin/sh
cat .tmp/sinopia.pid | xargs kill
cat .tmp/ghrs.pid | xargs kill
cp .tmp/.npmrc ~/.npmrc
rm -rf .tmp

View File

@ -1,7 +1,23 @@
#!/bin/sh
#!/bin/bash
set -e
npm run test:style
function cleanup {
set +e
cp .tmp/.npmrc ~/.npmrc
cat .tmp/sinopia.pid | xargs kill
cat .tmp/ghrs.pid | xargs kill
rm -rf .tmp
}
trap cleanup EXIT
[ -d ".tmp" ] && ./bin/post-test
mkdir -p .tmp/modules
@ -16,3 +32,5 @@ sleep 0.5
cp ~/.npmrc .tmp/.npmrc
cp tests/.npmrc ~/.npmrc
npm run test:integration

View File

@ -55,9 +55,9 @@
},
"scripts": {
"postpublish": "./bin/semantic-release.js post",
"posttest": "./bin/post-test",
"prepublish": "./bin/semantic-release.js pre",
"pretest": "./bin/pre-test",
"test": "standard && node tests | tap-spec"
"test:style": "standard",
"test:integration": "node tests | tap-spec",
"test": "./bin/test"
}
}