chore: make test command cleanup after itself and fail early for style errors
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user