gulp-browser/test.js

30 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

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