Skip to content

Commit

Permalink
Added coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonpincin committed Jul 3, 2013
1 parent 835d9bf commit 21a9a14
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@
*.swo
node_modules
npm-debug.log
test/.coverage
1 change: 1 addition & 0 deletions .npmignore
Expand Up @@ -3,3 +3,4 @@ example
node_modules
.gitignore
.npmignore
test/.coverage
22 changes: 19 additions & 3 deletions README.md
Expand Up @@ -144,10 +144,26 @@ arguments that was passed to the final callback.

`npm test`

or
Test scripts also support TAP when executed individually. You can use a tap consumer (such as [node-tap](https://github.com/isaacs/node-tap)) to consume
all tests:

`tap test`

or
# test coverage

`jasmine-node test`
Test coverage reporting requires you to have [istanbul](https://github.com/gotwarlost/istanbul) installed.

`npm install -g istanbul`

Then you can run the coverage report:

`npm run-script coverage`

```
=============================== Coverage summary ===============================
Statements : 100% ( 39/39 )
Branches : 100% ( 8/8 )
Functions : 100% ( 12/12 )
Lines : 100% ( 39/39 )
================================================================================
```
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -18,7 +18,8 @@
],
"main": "./index.js",
"scripts": {
"test": "jasmine-node test; echo >&2 'Tests support TAP. Use node-tap and consume TAP output with \"tap test\".'"
"test": "jasmine-node test",
"coverage": "istanbul cover --print summary --dir ./test/.coverage jasmine-node -- test 2> /dev/null || echo 'Istanbul required for test coverage reports: npm install -g istanbul'"
},
"engine": {
"node": ">=0.8.8"
Expand Down

0 comments on commit 21a9a14

Please sign in to comment.