-
-
Save jfmercer/053e8d527753171c8aab to your computer and use it in GitHub Desktop.
Automated PHPSpec tests with Gulp
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
var gulp = require('gulp'); | |
var phpspec = require('gulp-phpspec'); | |
var run = require('gulp-run'); | |
var notify = require('gulp-notify'); | |
var plumber = require('gulp-plumber'); | |
gulp.task('test', function() { | |
gulp.src('spec/**/*.php') | |
.pipe(plumber()) | |
.pipe(run('clear').exec()) | |
.pipe(phpspec('', { notify: true })) | |
.on('error', notify.onError({ | |
title: 'Dangit', | |
message: 'Your tests failed!' | |
// Optional notification fail icon | |
// icon: __dirname + '/fail.png' | |
})) | |
.pipe(notify({ | |
title: 'Success', | |
message: 'All tests have returned green!' | |
// optional pass notification icon | |
// icon: __dirname + '/pass.png' | |
})); | |
}); | |
gulp.task('watch', function() { | |
gulp.watch(['spec/**/*.php', 'src/**/*.php'], ['test']); | |
}); | |
gulp.task('default', ['test', 'watch']); |
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
{ | |
"private": true, | |
"devDependencies": { | |
"gulp" : "~3.8", | |
"gulp-phpspec" : "~0.3", | |
"gulp-run" : "~1.6", | |
"gulp-notify" : "~2.2", | |
"gulp-plumber" : "~1.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment