Skip to content

Commit

Permalink
#9: Working on the coveralls.io integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Inaki Anduaga committed Nov 15, 2014
1 parent 475f7ea commit f4916cd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ node_js:
before_script: #http://badsyntax.co/post/travis-ci-and-bower (these run after npm install)
- npm install -g bower
- bower install
after_success:
- coveralls

20 changes: 18 additions & 2 deletions gulp/unit-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var gulp = require('gulp');
var karma = require('karma').server;
var $ = require('gulp-load-plugins')({
pattern: ['wiredep', 'gulp-notify', 'gulp-angular-filesort', 'minimist', 'browser-sync']
pattern: ['wiredep', 'gulp-coveralls', 'gulp-notify', 'gulp-angular-filesort', 'minimist', 'browser-sync']
});

//Read CLI arguments & populate variables
Expand Down Expand Up @@ -89,7 +89,7 @@ function buildKarmaConfig(overrideOptions)
configFile: __dirname + '/../test/karma.conf.js',
files : buildTestFilelist(),
singleRun: true,
reporters : ['progress'],
reporters : ['progress']
};

//Code coverage configuration
Expand Down Expand Up @@ -160,6 +160,22 @@ gulp.task('test-view-coverage-report', null, function() {
});


// Submit generated code coverage information to coveralls
gulp.task('coveralls', 'Submit generated code coverage information to coveralls', function() {

GENERATE_COVERAGE_REPORT = true;
COVERAGE_FORMAT = 'lcov';

return karma.start(buildKarmaConfig(), function(exitCode) {

gulp.src('coverage/**/lcov.info')
.pipe($.coveralls());
});

});



//Task to fix the karma-runner jasmine version
//We need this because we can't get working v0.3.0 of karma-jasmine, which has the newer version.
//Once that's fixed, we don't need this
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"gulp-ngdocs" : "^0.1.3",
"karma-angular-filesort" : "^0.1.0",
"del" : "0.1.3",
"browser-sync" : "1.6.5"
"browser-sync" : "1.6.5",
"gulp-coveralls" : "0.1.3"
},
"engines": {
"node": ">=0.10.0"
Expand Down

0 comments on commit f4916cd

Please sign in to comment.