diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-09-14 01:21:13 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-09-14 01:21:13 +0200 |
commit | 48211a20695a882ed67f7a4446a78434aec386f3 (patch) | |
tree | ffff6206defd61e2685eb6584350c4022b854a0a /web/gulpfile.js | |
parent | 7b74d207f39e642e5029a4855da47314ce224a33 (diff) | |
download | mitmproxy-48211a20695a882ed67f7a4446a78434aec386f3.tar.gz mitmproxy-48211a20695a882ed67f7a4446a78434aec386f3.tar.bz2 mitmproxy-48211a20695a882ed67f7a4446a78434aec386f3.zip |
gulpfile: add tests and notify
Diffstat (limited to 'web/gulpfile.js')
-rw-r--r-- | web/gulpfile.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/web/gulpfile.js b/web/gulpfile.js index 55a99b15..9ec2a0a7 100644 --- a/web/gulpfile.js +++ b/web/gulpfile.js @@ -6,12 +6,21 @@ var jshint = require("gulp-jshint"); var less = require("gulp-less"); var livereload = require("gulp-livereload"); var minifyCSS = require('gulp-minify-css'); +var notify = require("gulp-notify"); var plumber = require("gulp-plumber"); +var qunit = require("gulp-qunit"); var react = require("gulp-react"); var sourcemaps = require('gulp-sourcemaps'); var uglify = require('gulp-uglify'); +var dont_break_on_errors = function(){ + return plumber(function(error){ + notify.onError("Error: <%= error.message %>").apply(this, arguments); + this.emit('end'); + }); +}; + var path = { dist: "../libmproxy/web/", js: { @@ -43,7 +52,7 @@ gulp.task("fonts", function () { function styles(files, dev) { return (gulp.src(files, {base: "src", cwd: "src"}) - .pipe(plumber()) + .pipe(dont_break_on_errors()) .pipe(dev ? sourcemaps.init() : gutil.noop()) .pipe(less()) .pipe(dev ? sourcemaps.write(".", {sourceRoot: "/static"}) : gutil.noop()) @@ -62,7 +71,7 @@ gulp.task("styles-prod", ["styles-app-prod", "styles-vendor-prod"]); function scripts(files, filename, dev) { return gulp.src(files, {base: "src", cwd: "src"}) - .pipe(plumber()) + .pipe(dont_break_on_errors()) .pipe(dev ? sourcemaps.init() : gutil.noop()) .pipe(react({harmony: true})) .pipe(concat(filename)) @@ -80,7 +89,7 @@ gulp.task("scripts-prod", ["scripts-app-prod", "scripts-vendor-prod"]); gulp.task("jshint", function () { return gulp.src(["src/js/**"]) - .pipe(plumber()) + .pipe(dont_break_on_errors()) .pipe(react({harmony: true})) .pipe(jshint()) .pipe(jshint.reporter("jshint-stylish")) @@ -92,6 +101,11 @@ gulp.task("html", function () { .pipe(livereload({ auto: false })); }); +gulp.task('test', function() { + return gulp.src('src/test.html') + .pipe(qunit({verbose: true})); +}); + common = ["fonts", "html", "jshint"]; gulp.task("dev", common.concat(["styles-dev", "scripts-dev"])); gulp.task("prod", common.concat(["styles-prod", "scripts-prod"])); |