Skip to content

Commit

Permalink
Test coverage and Coveralls first kick
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Kliment committed Sep 2, 2013
1 parent 51109d2 commit 30a5041
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ notifications:
- adam@apiary.io
on_success: change
on_failure: always
after_success:
- ./scripts/coveralls

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ This [README.md][Readme] is generated by build script in [`./scripts/build`] fro
[Readme]: https://github.com/apiaryio/gavel.js/blob/master/README.md
[Codo]: https://github.com/netzpirat/codo
[SpecRepo]: https://github.com/apiaryio/gavel/tree/master/node_js




34 changes: 19 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"gavel": "bin/gavel"
},
"dependencies": {
"amanda": "git://github.com/apiaryio/Amanda.git",
"async": "0.2.9",
"commander": "2.0.0",
"curl-trace-parser": "0.0.7",
"http-string-parser": "0.0.4",
"googlediff": "0.1.0"
"amanda": "git://github.com/apiaryio/Amanda.git",
"async": "0.2.9",
"commander": "2.0.0",
"curl-trace-parser": "0.0.7",
"http-string-parser": "0.0.4",
"googlediff": "0.1.0"
},
"devDependencies": {
"chai": "~1.7.2",
Expand All @@ -26,7 +26,11 @@
"prettyjson": "0.8.1",
"codo": "1.7.0",
"json-pointer": "0.0.3",
"sinon": "1.7.3"
"sinon": "1.7.3",
"coffee-coverage": "0.1.4",
"jscoverage": "~0.3.8",
"coveralls": "~2.2.0",
"mocha-lcov-reporter": "0.0.1"
},
"scripts": {
"test": "scripts/test",
Expand All @@ -50,14 +54,14 @@
],
"author": "Apiary Inc <support@apiary.io>",
"contributors": [
{
"name": "Adam Kliment",
"email": "adam@apiary.io"
},
{
"name": "Peter Grilli",
"email": "tully@apiary.io"
}
{
"name": "Adam Kliment",
"email": "adam@apiary.io"
},
{
"name": "Peter Grilli",
"email": "tully@apiary.io"
}
],
"license": "MIT",
"readmeFilename": "README.md",
Expand Down
17 changes: 17 additions & 0 deletions scripts/cov
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
# Usage:
# ./scripts/cov [reporter]
#
# Example:
# ./scripts/cov html-cov > cov.html

COV=./node_modules/coffee-coverage/bin/coffeecoverage
MOCHA=./node_modules/mocha/bin/mocha

REPORTER=$1
echo "Using Mocha reporter: $REPORTER" 1>&2
$COV --exclude node_modules,.git --path relative . ./src-cov 1>&2

find ./src-cov/test/unit | grep "\-test" | xargs $MOCHA --require ./src-cov/src/gavel.js --reporter $REPORTER --compilers 'coffee:coffee-script'

rm -rf ./src-cov
3 changes: 3 additions & 0 deletions scripts/coveralls
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

./scripts/cov mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js

0 comments on commit 30a5041

Please sign in to comment.