Permalink
Browse files

Merge pull request #25 from XadillaX/feature/add_makefile

add makefile
  • Loading branch information...
XadillaX committed Oct 21, 2015
2 parents 7eda9df + 21d4198 commit b7c230455e97b663ab6bda6d4694a4e5f63bc06d
Showing with 33 additions and 7 deletions.
  1. +2 −6 .travis.yml
  2. +30 −0 Makefile
  3. +1 −1 package.json
@@ -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
@@ -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
@@ -26,7 +26,7 @@
"should": "^4.3.0"
},
"scripts": {
"test": "NODE_ENV=test mocha -t 3000"
"test": "make test"
},
"repository": {
"type": "git",

0 comments on commit b7c2304

Please sign in to comment.