Gulp test runner for Lab.
Gulp-lab supports the same options as Lab.
npm install gulp-lab --save-dev
Gulp-lab can be used with String, Array and Object options or without.
Gulp-lab can emit an Error when tests fails. Simply use options object with property "emitLabError" on true! By default, "emitLabError" is false.
// gulpfile.js
var gulp = require('gulp');
var lab = require('gulp-lab');
gulp.task('test', function () {
return gulp.src('test')
.pipe(lab());
});
gulp.task('default', 'test');// gulpfile.js
var gulp = require('gulp');
var lab = require('gulp-lab');
gulp.task('test', function () {
return gulp.src('test')
.pipe(lab('-v -l -C'));
});
gulp.task('default', 'test');// gulpfile.js
var gulp = require('gulp');
var lab = require('gulp-lab');
gulp.task('test', function () {
return gulp.src('test')
.pipe(lab(['-v', '-l', '-C']));
});
gulp.task('default', 'test');NOTE: args property can be either a String or an Array and is OPTIONAL!
// gulpfile.js
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var lab = require('gulp-lab');
gulp.task('test', function () {
return gulp.src('./test/**/*.js')
.pipe(lab({
args: '-v -C',
opts: {
emitLabError: true
}
}))
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('default', 'test');