2016-01-31 23:04:05 +00:00
|
|
|
/// <reference path="./typings/main.d.ts" />
|
2016-02-01 01:28:43 +00:00
|
|
|
console.log("**** starting test ****");
|
2016-01-24 23:42:11 +00:00
|
|
|
var plugins = {
|
|
|
|
beautylog: require("beautylog"),
|
|
|
|
gulp: require("gulp"),
|
2016-02-01 01:28:43 +00:00
|
|
|
gulpBrowser: require("../index.js"),
|
2016-01-24 23:42:11 +00:00
|
|
|
gulpCallFunction: require("gulp-callfunction")
|
|
|
|
};
|
|
|
|
|
2015-10-26 22:27:33 +00:00
|
|
|
|
|
|
|
var pipeWorked = function() {
|
2016-01-24 23:42:11 +00:00
|
|
|
plugins.beautylog.info("Pipe didn't break! Ready for Primetime!");
|
2015-10-26 22:27:33 +00:00
|
|
|
};
|
|
|
|
|
2016-01-24 23:42:11 +00:00
|
|
|
plugins.beautylog.log('Now trying to browserify a testfile...');
|
|
|
|
plugins.gulp.task('gulpBrowserTest',function(cb) {
|
2016-02-01 01:28:43 +00:00
|
|
|
var stream = plugins.gulp.src('./testassets/browserifyGulpTest.js')
|
2016-01-24 23:42:11 +00:00
|
|
|
.pipe(plugins.gulpBrowser.browserify())
|
2016-02-01 01:28:43 +00:00
|
|
|
.pipe(plugins.gulp.dest("./testassets/result/"))
|
2016-01-24 23:42:11 +00:00
|
|
|
.pipe(plugins.gulpCallFunction(pipeWorked));
|
2015-12-05 21:29:06 +00:00
|
|
|
return stream;
|
2015-10-26 22:27:33 +00:00
|
|
|
});
|
2016-01-24 23:42:11 +00:00
|
|
|
plugins.gulp.task('gulpBrowserTestError',function(cb) {
|
2016-02-01 01:28:43 +00:00
|
|
|
plugins.beautylog.info("Expecting an error:");
|
|
|
|
var stream = plugins.gulp.src('./testassets/browserifyGulpTestError.js')
|
2016-01-24 23:42:11 +00:00
|
|
|
.pipe(plugins.gulpBrowser.browserify())
|
2016-02-01 01:28:43 +00:00
|
|
|
.pipe(plugins.gulp.dest("./testassets/result/"))
|
2016-01-24 23:42:11 +00:00
|
|
|
.pipe(plugins.gulpCallFunction(pipeWorked));
|
2015-12-05 21:29:06 +00:00
|
|
|
return stream;
|
|
|
|
});
|
2016-01-24 23:42:11 +00:00
|
|
|
plugins.gulp.task("default",['gulpBrowserTest','gulpBrowserTestError'],function(){
|
|
|
|
plugins.beautylog.success("Test passed!");
|
2015-12-05 21:29:06 +00:00
|
|
|
});
|
2016-01-24 23:42:11 +00:00
|
|
|
plugins.gulp.start.apply(plugins.gulp, ['default']);
|