run tests on publish

This commit is contained in:
Sebastian McKenzie 2014-10-09 14:04:31 +11:00
parent dfd378c7d6
commit 66b347576c
2 changed files with 18 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
.DS_Store .DS_Store
node_modules node_modules
test/tmp
*.log *.log
*.cache *.cache
/templates.json /templates.json

View File

@ -3,13 +3,15 @@ MOCHA_CMD = node_modules/mocha/bin/_mocha
export NODE_ENV = test export NODE_ENV = test
.PHONY: clean test test-cov test-travis publish bench .PHONY: clean test test-cov test-travis publish bench build
clean: clean:
rm -rf coverage templates.json rm -rf coverage templates.json test/tmp
test: test:
make clean
$(MOCHA_CMD) $(MOCHA_CMD)
rm -rf test/tmp
bench: bench:
node node_modules/matcha/bin/_matcha node node_modules/matcha/bin/_matcha
@ -17,13 +19,26 @@ bench:
test-cov: test-cov:
make clean make clean
node $(ISTANBUL_CMD) $(MOCHA_CMD) -- node $(ISTANBUL_CMD) $(MOCHA_CMD) --
rm -rf test/tmp
test-travis: test-travis:
node $(ISTANBUL_CMD) $(MOCHA_CMD) --report lcovonly -- --reporter spec node $(ISTANBUL_CMD) $(MOCHA_CMD) --report lcovonly -- --reporter spec
if test -n "$$CODECLIMATE_REPO_TOKEN"; then codeclimate < coverage/lcov.info; fi if test -n "$$CODECLIMATE_REPO_TOKEN"; then codeclimate < coverage/lcov.info; fi
build:
# build for the browser
publish: publish:
make clean make clean
rm -rf node_modules
npm install
node bin/cache-templates node bin/cache-templates
make test
npm publish npm publish
# todo - auto-create tag
make clean make clean