-
-
Save sosso/c106588d44328ca76d1b 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
/* | |
beforehand, run these via cli: | |
npm install gulp -g | |
run this from the same directory where you'll be writing your tests | |
npm install gulp gulp-phpspec gulp-run gulp-notify gulp-run --save-dev | |
To set up autowatch, do `gulp watch` from the command line. | |
*/ | |
var gulp = require('gulp'); | |
var phpspec = require('gulp-phpspec'); | |
var run = require('gulp-run'); | |
var notify = require('gulp-notify'); | |
gulp.task('test', function() { | |
gulp.src('spec/**/*.php') | |
.pipe(run('clear')) | |
.pipe(phpspec('', { notify: true })) | |
.on('error', notify.onError({ | |
title: 'Dangit', | |
message: 'Your tests failed!', | |
icon: __dirname + '/fail.png' | |
})) | |
.pipe(notify({ | |
title: 'Success', | |
message: 'All tests have returned green!' | |
})); | |
}); | |
gulp.task('watch', function() { | |
gulp.watch(['spec/**/*.php', 'src/**/*.php'], ['test']); | |
}); | |
gulp.task('default', ['test', 'watch']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment