Skip to content

Commit

Permalink
Submit coverage to coveralls in travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyruppel committed Jul 19, 2014
1 parent eab9d0a commit 8da0976
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ language: node_js
node_js:
- "0.11"
- "0.10"
before_script:
- npm run jscov
after_script:
- npm run coverage
11 changes: 9 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
var gulp = require('gulp');
var jscs = require('gulp-jscs');
var jscov = require('gulp-jscoverage');

gulp.task('lint', function() {
gulp.task('jscs', function() {
return gulp.src([
'src/*.js',
'lib/*.js',
'test/*.js'
]).pipe(jscs());
});

gulp.task('jscov', function() {
gulp.src('lib/*.js')
.pipe(jscov('index.js'))
.pipe(gulp.dest('./lib-cov'));
});
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = process.env.JSCOV
? require('./lib-cov')
: require('./lib/underscore.inflection.js');
File renamed without changes.
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
"name": "underscore.inflection",
"version": "1.0.0",
"description": "ActiveSupport::Inflector, for underscore!",
"main": "src/underscore.inflection.js",
"main": "index.js",
"engines": {
"node": ">=0.10.0 <0.12"
},
"scripts": {
"test": "mocha",
"lint": "gulp lint"
"coverage": "JSCOV=1 mocha -R mocha-lcov-reporter | coveralls",
"jscs": "gulp jscs",
"jscov": "gulp jscov"
},
"repository": {
"type": "git",
Expand All @@ -35,6 +37,8 @@
"gulp": "~3.8.6",
"gulp-jscs": "~0.6.0",
"coveralls": "~2.11.1",
"mocha-lcov-reporter": "0.0.1"
"mocha-lcov-reporter": "0.0.1",
"jscoverage": "~0.5.5",
"gulp-jscoverage": "~0.1.0"
}
}
2 changes: 1 addition & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/underscore/underscore.js"></script>
<script src="../src/underscore.inflection.js"></script>
<script src="../lib/underscore.inflection.js"></script>
<script>
// Make `expect` available
expect = chai.expect;
Expand Down

0 comments on commit 8da0976

Please sign in to comment.