Skip to content

Commit

Permalink
将覆盖率改为blanket
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed May 17, 2013
1 parent 39200df commit 3d9dc2c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
15 changes: 7 additions & 8 deletions Makefile
@@ -1,20 +1,19 @@
TESTS = test/test.js
REPORTER = spec
TIMEOUT = 10000
JSCOVERAGE = ./node_modules/jscover/bin/jscover
MOCHA_OPTS =

test:
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)

test-cov: lib-cov
@EVENTPROXY_COV=1 $(MAKE) test REPORTER=dot
@EVENTPROXY_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
test-cov:
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=html-cov > coverage.html
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=travis-cov

lib-cov:
@rm -rf $@
@$(JSCOVERAGE) lib $@
test-all: test test-cov

.PHONY: test test-cov lib-cov
.PHONY: test test-cov test-all
2 changes: 1 addition & 1 deletion index.js
@@ -1 +1 @@
module.exports = process.env.EVENTPROXY_COV ? require('./lib-cov/eventproxy') : require('./lib/eventproxy');
module.exports = require('./lib/eventproxy');
16 changes: 13 additions & 3 deletions package.json
Expand Up @@ -16,12 +16,22 @@
"dependencies": {},
"devDependencies": {
"mocha": "*",
"jscover": "*",
"blanket": "*",
"pedding": "*",
"chai": "*"
"chai": "*",
"travis-cov": "*"
},
"scripts": {
"test": "make test"
"test": "make test-all",
"blanket": {
"pattern": "eventproxy/lib",
"data-cover-flags": {
"debug": false
}
},
"travis-cov": {
"threshold": 70
}
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 3d9dc2c

Please sign in to comment.