-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to gulp for test, add coveralls and codacy badges, bump deps
- Loading branch information
1 parent
db853e2
commit edbc0f5
Showing
6 changed files
with
81 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
node_modules | ||
coverage.html | ||
lib-cov/ | ||
reports/ | ||
.coverrun | ||
.coverdata | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ node_js: | |
- "iojs" | ||
- "0.12" | ||
- "0.10" | ||
before_install: | ||
- npm install -g gulp@3.8.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* @description - gulp build file | ||
* | ||
* @copyright Ian Kelly 2015 | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var gulp = require('gulp'); | ||
var jshint = require('gulp-jshint'); | ||
var mocha = require('gulp-mocha'); | ||
var cover = require('gulp-coverage'); | ||
var coveralls = require('gulp-coveralls'); | ||
|
||
// set coveralls environmental variable | ||
process.env['COVERALLS_REPO_TOKEN'] = 'rCIR66aQA8jUA7Berlh1PHd917mjMt4hU'; | ||
|
||
/** | ||
* Linting task | ||
*/ | ||
gulp.task('lint', function() { | ||
return gulp.src(['lib/**/*.js', 'test/unit/**/*.js', 'gulpfile.js']) | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter('default')) | ||
.pipe(jshint.reporter('fail')); | ||
}); | ||
|
||
/** | ||
* Task for developer test and coverage report | ||
*/ | ||
gulp.task('test', ['lint'], function () { | ||
return gulp.src(['lib/**/*.js', 'test/unit/**/*.js'], { read: false }) | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter('default')) | ||
.pipe(jshint.reporter('fail')) | ||
.pipe(cover.instrument({ | ||
pattern: ['lib/**/*.js'] | ||
})) | ||
.pipe(mocha()) | ||
.pipe(cover.gather()) | ||
.pipe(cover.format()) | ||
.pipe(gulp.dest('reports')); | ||
}); | ||
|
||
/** | ||
* Task for travis-ci which pipes coverage to coveralls | ||
*/ | ||
gulp.task('test-coveralls', ['lint'], function() { | ||
return gulp.src(['lib/**/*.js', 'test/unit/**/*.js'], { read: false }) | ||
.pipe(cover.instrument({ | ||
pattern: ['lib/**/*.js'] | ||
})) | ||
.pipe(mocha()) | ||
.pipe(cover.gather()) | ||
.pipe(cover.format({ | ||
reporter: 'lcov' | ||
})) | ||
.pipe(coveralls()); | ||
}); | ||
|
||
gulp.task('default', ['lint', 'test']); | ||
gulp.task('travis', ['lint', 'test-coveralls']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters