Created
November 13, 2015 17:49
-
-
Save drazisil/f3dd2316e860710f5228 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
'use strict' | |
var gulp = require('gulp') | |
var standard = require('gulp-standard') | |
var mocha = require('gulp-mocha') | |
var istanbul = require('gulp-istanbul') | |
var coveralls = require('gulp-coveralls') | |
gulp.task('standard', function () { | |
return gulp.src(['./app.js']) | |
.pipe(standard()) | |
.pipe(standard.reporter('default', { | |
breakOnError: true | |
})) | |
}) | |
gulp.task('pre-test', function () { | |
return gulp.src(['lib/**/*.js']) | |
// Covering files | |
.pipe(istanbul()) | |
// Force `require` to return covered files | |
.pipe(istanbul.hookRequire()) | |
}) | |
gulp.task('test', ['pre-test'], function (cb) { | |
return gulp.src([ | |
'./test/**/*.js' | |
]) | |
.pipe(mocha({ | |
reporter: 'mocha-junit-reporter', | |
reporterOptions: { | |
mochaFile: process.env.CIRCLE_TEST_REPORTS + '/junit/results.xml' | |
} | |
})) | |
.pipe(istanbul.writeReports()) // stores reports in "coverage" directory | |
}) | |
gulp.task('coveralls', function (cb) { | |
return gulp.src('./coverage/lcov.info') | |
.pipe(coveralls()) | |
}) | |
gulp.task('dev', ['standard', 'test', 'coveralls']) | |
gulp.task('default', ['dev']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment