Skip to content

Commit

Permalink
Merge pull request #2 from aleafs/use_blanket
Browse files Browse the repository at this point in the history
use blanket
  • Loading branch information
aleafs committed Jul 23, 2013
2 parents 0b16cac + 7e0aa4c commit 9771214
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
@@ -1,7 +1,8 @@
language: node_js
node_js:
- 0.6
- 0.8
- 0.9
- 0.10
- 0.11

script: make test
script: make coveralls
26 changes: 18 additions & 8 deletions Makefile
@@ -1,17 +1,27 @@
TESTS = test/*.js
REPORTER = spec
TIMEOUT = 5000
JSCOVERAGE = ./node_modules/visionmedia-jscoverage/jscoverage
MOCHA = ./node_modules/mocha/bin/mocha
MOCHA_OPTS =

test:
install:
@npm install
@$(MOCHA) --reporter $(REPORTER) --timeout $(TIMEOUT) $(MOCHA_OPTS) $(TESTS)

cov:
@npm install
-mv -f lib lib.bak && $(JSCOVERAGE) lib.bak lib
-$(MOCHA) --reporter html-cov --timeout $(TIMEOUT) $(MOCHA_OPTS) $(TESTS) > ./coverage.html
-rm -rf lib && mv -f lib.bak lib
test: install
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)

cov: install
@rm -f coverage.html
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=html-cov > coverage.html
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=travis-cov

coveralls: install
@$(MAKE) test
@echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js

.PHONY: test
13 changes: 11 additions & 2 deletions package.json
Expand Up @@ -18,10 +18,19 @@
"devDependencies": {
"should" : ">=0.4.2",
"mocha" : ">=0.9.0",
"visionmedia-jscoverage" : ">=1.0.0"
"blanket": "*",
"coveralls" : "*",
"travis-cov": "*",
"mocha-lcov-reporter": "*"
},
"main" : "./index.js",
"scripts": {
"test": "make test"
"test": "make test",
"blanket": {
"pattern": "/dida/lib"
},
"travis-cov": {
"threshold": 98
}
}
}

0 comments on commit 9771214

Please sign in to comment.