Skip to content

Commit

Permalink
Coveralls support
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Henke committed Aug 1, 2013
1 parent 0245f13 commit 94f1ed5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service_name: travis-ci
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
node_modules/
lib-cov/
test/coverage.html
test/coverage.html
*.lcov
Empty file added Makefile
Empty file.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
process.env.SWRAP_COV = process.argv.indexOf( "--SWRAP_COV" ) > -1;
module.exports = process.env.SWRAP_COV === "true" ?
module.exports = process.env.SWRAP_COV ?
require( "./lib-cov/swrap" ) :
require( "./lib/swrap" );
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
"chai": "~1.7.2",
"mocha": "~1.12.0",
"jscoverage": "https://github.com/gustavohenke/jscoverage/tarball/master",
"sinon": "~1.7.3"
"sinon": "~1.7.3",
"mocha-lcov-reporter": "0.0.1",
"coveralls": "~2.1.0"
},
"scripts": {
"prepublish": "npm prune",
"test": "node test/index.js",
"posttest": "npm run-script coverage",
"precoverage": "node node_modules/jscoverage/bin/jscoverage lib",
"coverage": "node test/index.js --SWRAP_COV > test/coverage.html"
"pretest": "./node_modules/jscoverage/bin/jscoverage lib lib-cov",
"test": "SWRAP_COV=1 ./node_modules/mocha/bin/mocha -R mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js"
},
"engines": {
"node": ">=0.8.0"
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// Run tests when called via node CLI
var mocha = new ( require( "mocha" ) )({
ui: "tdd",
reporter: process.env.SWRAP_COV === "true" ? "html-cov" : "spec"
reporter: process.env.SWRAP_COV === "true" ? "mocha-lcov-reporter" : "spec"
});

files.forEach(function( file ) {
Expand Down

0 comments on commit 94f1ed5

Please sign in to comment.