Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
support coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Jun 24, 2013
1 parent f9ba58b commit bfe58e2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
@@ -1,5 +1,6 @@
language: node_js
node_js:
- 0.9
- 0.8
- 0.6
- '0.10'
- '0.11'
script: make test-coveralls
2 changes: 1 addition & 1 deletion LICENSE.txt
@@ -1,6 +1,6 @@
This software is licensed under the MIT License.

Copyright (C) 2012 by fengmk2 <fengmk2@gmail.com>
Copyright (C) 2012 - 2013 by fengmk2 <fengmk2@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
22 changes: 14 additions & 8 deletions Makefile
@@ -1,7 +1,7 @@
TESTS = test/*.test.js
REPORTER = spec
TIMEOUT = 2500
JSCOVERAGE = ./node_modules/jscover/bin/jscover
MOCHA_OPTS =

install:
@npm install
Expand All @@ -10,14 +10,20 @@ test: install
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)

test-cov: install lib-cov
@CONNECT_RT_COV=1 $(MAKE) test REPORTER=dot
@CONNECT_RT_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
test-cov:
@rm -f coverage.html
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=html-cov > coverage.html
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=travis-cov
@ls -lh coverage.html

lib-cov:
@rm -rf $@
@$(JSCOVERAGE) lib $@
test-coveralls:
@$(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-cov test lib-cov install
test-all: test test-cov

.PHONY: install test test-cov test-all test-coveralls
8 changes: 3 additions & 5 deletions README.md
@@ -1,12 +1,10 @@
connect-rt [![Build Status](https://secure.travis-ci.org/fengmk2/connect-rt.png)](http://travis-ci.org/fengmk2/connect-rt)
connect-rt [![Build Status](https://secure.travis-ci.org/fengmk2/connect-rt.png)](http://travis-ci.org/fengmk2/connect-rt) [![Coverage Status](https://coveralls.io/repos/fengmk2/connect-rt/badge.png)](https://coveralls.io/r/fengmk2/connect-rt)
=======

![logo](https://raw.github.com/fengmk2/connect-rt/master/logo.png)

connect response time middleware, include micro second.

* jscoverage: [100%](http://fengmk2.github.com/coverage/connect-rt.html)

## Install

```bash
Expand Down Expand Up @@ -45,7 +43,7 @@ Fastest is Date.now()

(The MIT License)

Copyright (c) 2012 fengmk2 &lt;fengmk2@gmail.com&gt;
Copyright (c) 2012 - 2013 fengmk2 &lt;fengmk2@gmail.com&gt;

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -64,4 +62,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9 changes: 7 additions & 2 deletions package.json
Expand Up @@ -4,15 +4,20 @@
"description": "connect response time middleware, include micro second.",
"main": "index.js",
"scripts": {
"test": "make test"
"test": "make test-all",
"blanket": { "pattern": "connect-rt/lib" },
"travis-cov": { "threshold": 100 }
},
"dependencies": {
"microtime": ">=0.3.3"
},
"devDependencies": {
"connect": "*",
"should": "*",
"jscover": "*",
"blanket": "*",
"travis-cov": "*",
"coveralls": "*",
"mocha-lcov-reporter": "*",
"supertest": "*",
"mocha": "*"
},
Expand Down

0 comments on commit bfe58e2

Please sign in to comment.