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

Commit

Permalink
add coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Dec 21, 2016
1 parent d763971 commit b9ea58e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ node_js:
- "4"
- "6"
- "7"
script: "npm run test-cov"
after_script: "npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ A trie router for toa.

[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]
[![Downloads][downloads-image]][downloads-url]

## v2 has a breaking change from v1.x https://github.com/toajs/toa-router/tree/v1.5.2
Expand Down Expand Up @@ -251,5 +252,8 @@ The MIT License (MIT)
[travis-url]: https://travis-ci.org/toajs/toa-router
[travis-image]: http://img.shields.io/travis/toajs/toa-router.svg

[coveralls-url]: https://coveralls.io/r/toajs/toa-router
[coveralls-image]: https://coveralls.io/repos/toajs/toa-router/badge.svg

[downloads-url]: https://npmjs.org/package/toa-router
[downloads-image]: http://img.shields.io/npm/dm/toa-router.svg?style=flat-square
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"authors": [
"Yan Qing <[email protected]>"
],
"version": "2.0.0",
"version": "2.0.1",
"main": "index.js",
"repository": {
"type": "git",
Expand All @@ -23,18 +23,19 @@
"trie-router"
],
"dependencies": {
"methods": "^1.1.2",
"route-trie": "^2.0.2",
"thunks": "^4.7.5"
},
"devDependencies": {
"istanbul": "^0.4.5",
"standard": "^8.6.0",
"supertest": "^2.0.1",
"tman": "^1.6.4",
"toa": "^2.4.2"
},
"scripts": {
"test": "standard && tman"
"test": "standard && tman",
"test-cov": "istanbul cover _tman"
},
"files": [
"index.js",
Expand Down
7 changes: 4 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ tman.suite('toa-router', function () {
}, function () {
called++
assert.strictEqual(called, 2)
}, function () {
}, function (done) {
called++
assert.strictEqual(called, 3)
this.body = 'OK'
done()
})

let server = newApp(router)
Expand Down Expand Up @@ -164,8 +165,8 @@ tman.suite('toa-router', function () {

let router = new Router()
router.define('/api')
.get(middleware)
.head(middleware)
.get(middleware, middleware)
.head([middleware, middleware])
.post(middleware)
.put(middleware)
.patch(middleware)
Expand Down

0 comments on commit b9ea58e

Please sign in to comment.