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:34:31 +02:00
parent 6763a006d2
commit d4f6ee0d6a
3 changed files with 22 additions and 13 deletions
Executable
+36
View File
@@ -0,0 +1,36 @@
#!/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
export DEBUG=ghrs:cli
./node_modules/.bin/sinopia ./tests/config.yml & echo $! >> .tmp/sinopia.pid
./node_modules/.bin/github-release-fake-server -p 4343 & echo $! >> .tmp/ghrs.pid
sleep 0.5
cp ~/.npmrc .tmp/.npmrc
cp tests/.npmrc ~/.npmrc
npm run test:integration