Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #25 from XadillaX/feature/add_makefile
add makefile
  • Loading branch information
XadillaX committed Oct 21, 2015
2 parents 7eda9df + 21d4198 commit b7c2304
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
8 changes: 2 additions & 6 deletions .travis.yml
Expand Up @@ -20,9 +20,5 @@ addons:
- gcc-4.8
- g++-4.8
- clang
before_script:
- mysql -e 'create database myapp_test;'
- memcached -p 11211 -d
- memcached -p 11212 -d
- memcached -p 11213 -d
after_script: istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
before_script: make before-test-travis
after_script: make test-coveralls
30 changes: 30 additions & 0 deletions Makefile
@@ -0,0 +1,30 @@
TIMEOUT = 3000
MOCHA = ./node_modules/.bin/_mocha
ISTANBUL = ./node_modules/.bin/istanbul
COVERALLS = ./node_modules/coveralls/bin/coveralls.js

clean:
@rm -rf node_modules

install:
@npm install -d --registry=http://registry.npm.taobao.org/

test: install
@NODE_ENV=test $(MOCHA) -t $(TIMEOUT)

before-test-travis: install
@mysql -e 'create database myapp_test;' & \
memcached -p 11211 -d & \
memcached -p 11212 -d & \
memcached -p 11213 -d

test-coveralls: install
@NODE_ENV=test $(ISTANBUL) cover $(MOCHA) \
-t $(TIMEOUT) \
--report lcovonly \
-- \
-R spec && cat ./coverage/lcov.info | \
\
$(COVERALLS) && rm -rf ./coverage

.PHONY: test
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -26,7 +26,7 @@
"should": "^4.3.0"
},
"scripts": {
"test": "NODE_ENV=test mocha -t 3000"
"test": "make test"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit b7c2304

Please sign in to comment.