gulp-browser/test/test.ts

45 lines
1.6 KiB
TypeScript
Raw Normal View History

2016-02-26 16:57:53 +00:00
/// <reference path="../ts/typings/main.d.ts" />
let plugins = {
beautylog: require("beautylog"),
gulp: require("gulp"),
2016-02-26 16:57:53 +00:00
gulpBrowser: require("../dist/index.js"),
2016-02-01 02:38:58 +00:00
gulpFunction: require("gulp-function")
};
let should = require("should");
describe("gulpBrowser", function () {
describe(".browserify", function () {
it("should run through smoothly", function (done) {
2016-02-09 19:49:12 +00:00
this.timeout(30000);
let stream = plugins.gulp.src('./test/testBrowserifyNormal.js')
.pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("./test/result/"))
.pipe(plugins.gulpFunction(done));
});
it("should throw an error, when a module is not found", function (done) {
let d = require('domain').create();
let doneCalled = false
d.on("error",function(error){
console.log(error.message)
if(!doneCalled){
done();
doneCalled = true;
}
});
d.run(function() {
let stream = plugins.gulp.src("./test/testBrowserifyError.js")
.pipe(plugins.gulpBrowser.browserify());
2016-02-01 02:10:58 +00:00
});
});
it("should run through with an empty file", function (done) {
let stream = plugins.gulp.src('./test/testBrowserifyEmpty.js')
.pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("./test/result/"))
.pipe(plugins.gulpFunction(done));
2016-02-01 02:10:58 +00:00
});
});
2015-10-26 22:27:33 +00:00
});