2015-10-26 22:27:33 +00:00
|
|
|
/// <reference path="./typings/tsd.d.ts" />
|
|
|
|
var gulp = require("gulp");
|
|
|
|
var gulpBrowser = require("./index.js");
|
|
|
|
var pr = require("pushrocks");
|
|
|
|
var gulpCallFunction = require("gulp-callfunction");
|
|
|
|
|
|
|
|
var pipeWorked = function() {
|
2015-12-05 21:29:06 +00:00
|
|
|
pr.beautylog.info("Pipe didn't break! Ready for Primetime!");
|
2015-10-26 22:27:33 +00:00
|
|
|
};
|
|
|
|
|
2015-10-26 22:38:29 +00:00
|
|
|
pr.beautylog.log('Now trying to browserify a testfile...');
|
2015-10-26 22:27:33 +00:00
|
|
|
gulp.task('gulpBrowserTest',function(cb) {
|
2015-12-05 21:29:06 +00:00
|
|
|
var stream =gulp.src('./test/browserifyGulpTest.js')
|
2015-10-26 22:27:33 +00:00
|
|
|
.pipe(gulpBrowser.browserify())
|
|
|
|
.pipe(gulp.dest("./test/result/"))
|
|
|
|
.pipe(gulpCallFunction(pipeWorked));
|
2015-12-05 21:29:06 +00:00
|
|
|
return stream;
|
2015-10-26 22:27:33 +00:00
|
|
|
});
|
2015-12-05 21:29:06 +00:00
|
|
|
gulp.task('gulpBrowserTestError',function(cb) {
|
|
|
|
var stream = gulp.src('./test/browserifyGulpTestError.js')
|
|
|
|
.pipe(gulpBrowser.browserify())
|
|
|
|
.pipe(gulp.dest("./test/result/"))
|
|
|
|
.pipe(gulpCallFunction(pipeWorked));
|
|
|
|
return stream;
|
|
|
|
});
|
|
|
|
gulp.task("default",['gulpBrowserTest','gulpBrowserTestError'],function(){
|
|
|
|
pr.beautylog.success("Test passed!");
|
|
|
|
});
|
|
|
|
gulp.start.apply(gulp, ['default']);
|