Merge pull request #311 from dead-horse/coverage

add coverage
This commit is contained in:
TJ Holowaychuk 2014-07-05 14:23:35 -07:00
commit 63489495e1
5 changed files with 30 additions and 5 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
node_modules node_modules
test.js test.js
coverage

View file

@ -3,3 +3,4 @@ benchmarks
examples examples
test test
Makefile Makefile
coverage

View file

@ -1,4 +1,5 @@
language: node_js language: node_js
node_js: node_js:
- "0.11" - "0.11"
script: "make test-travis"
after_script: "npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls"

View file

@ -3,14 +3,35 @@ SRC = lib/*.js
include node_modules/make-lint/index.mk include node_modules/make-lint/index.mk
TESTS = test/application \
test/context/* \
test/request/* \
test/response/*
test: test:
@NODE_ENV=test ./node_modules/.bin/mocha \ @NODE_ENV=test ./node_modules/.bin/mocha \
--require should \ --require should \
--harmony-generators \ --harmony-generators \
test/application \ $(TESTS) \
test/context/* \ --bail
test/request/* \
test/response/* \ test-cov:
@NODE_ENV=test node --harmony-generators \
node_modules/.bin/istanbul cover \
./node_modules/.bin/_mocha \
-- -u exports \
--require should \
$(TESTS) \
--bail
test-travis:
@NODE_ENV=test node --harmony-generators \
node_modules/.bin/istanbul cover \
./node_modules/.bin/_mocha \
--report lcovonly \
-- -u exports \
--require should \
$(TESTS) \
--bail --bail
bench: bench:

View file

@ -43,6 +43,7 @@
"should": "^3.1.0", "should": "^3.1.0",
"mocha": "^1.17.0", "mocha": "^1.17.0",
"supertest": "~0.13.0", "supertest": "~0.13.0",
"istanbul-harmony": "~0.2.9",
"make-lint": "^1.0.1" "make-lint": "^1.0.1"
}, },
"engines": { "engines": {