gulp-function/test/test.js
2016-03-26 17:22:46 +01:00

103 lines
13 KiB
JavaScript

/// <reference path="../ts/typings/main.d.ts" />
var gulp = require("gulp");
var gulpFunction = require("../dist/index.js");
var beautylog = require("beautylog");
var Q = require("q");
var myFunction = function () {
var done = Q.defer();
beautylog.log("Function executed");
done.resolve();
return done.promise;
};
var myFunction2 = function () {
var done = Q.defer();
beautylog.ok("Function2 executed");
done.resolve();
return done.promise;
};
var myFunction3 = function () {
var done = Q.defer();
beautylog.success("Function3 executed");
done.resolve();
return done.promise;
};
var beforeFunction = function () {
var done = Q.defer();
beautylog.success("beforeFunction executed");
done.resolve();
return done.promise;
};
var middleFunctionRun = false;
var middleFunction = function () {
var done = Q.defer();
beautylog.success("middleFunction executed");
setTimeout(function () {
beautylog.log("timeout fired");
middleFunctionRun = true;
done.resolve();
}, 500);
return done.promise;
};
var afterFunction = function () {
var done = Q.defer();
beautylog.success("afterFunction executed");
done.resolve();
return done.promise;
};
var timeoutFunction = function () {
var done = Q.defer();
setTimeout(function () {
beautylog.log("largeTimeout fired");
done.resolve();
}, 2000);
return done.promise;
};
describe("gulpFunction", function () {
it("should run through smoothly with " + "'forEach'".blue, function (done) {
gulp.src('./test/*.md')
.pipe(gulpFunction(myFunction, 'forEach'))
.pipe(gulp.dest("./test/result/"));
gulp.src('./test/*.md')
.pipe(gulpFunction([myFunction2, myFunction3], 'forEach'))
.pipe(gulp.dest("./test/result/"))
.pipe(gulpFunction(done, "atEnd"));
});
it("should run through smoothly with " + "'atEnd'".blue, function (done) {
gulp.src('./test/*.md')
.pipe(gulpFunction(myFunction, 'atEnd'))
.pipe(gulp.dest("./test/result/"));
gulp.src('./test/*.md')
.pipe(gulpFunction([myFunction2, myFunction3], 'atEnd'))
.pipe(gulp.dest("./test/result/"))
.pipe(gulpFunction(done, "atEnd"));
});
it("should run through smoothly once with " + "'atFirst'".blue, function (done) {
gulp.src('./test/*.md')
.pipe(gulpFunction([myFunction2, myFunction3], 'forFirst'))
.pipe(gulp.dest("./test/result/"))
.pipe(gulpFunction(done, "atEnd"));
});
it("should run in order", function (done) {
this.timeout(5000);
var stream = gulp.src('./test/*.md')
.pipe(gulpFunction([beforeFunction, middleFunction, middleFunction], 'atEnd'))
.pipe(gulpFunction(function () {
beautylog.log("stream progressed");
var done2 = Q.defer();
done2.resolve();
return done2.promise;
}, "forEach"))
.pipe(gulpFunction(function () {
beautylog.log("nextStep");
}))
.pipe(gulpFunction(afterFunction, "atEnd"))
.pipe(gulpFunction(timeoutFunction, "atEnd"));
stream.on("finish", function () {
beautylog.info("stream finished");
done();
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUMzQixJQUFJLFlBQVksR0FBRyxPQUFPLENBQUMsa0JBQWtCLENBQUMsQ0FBQztBQUMvQyxJQUFJLFNBQVMsR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUM7QUFDckMsSUFBSSxDQUFDLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDO0FBRXJCLElBQUksVUFBVSxHQUFHO0lBQ2IsSUFBSSxJQUFJLEdBQUcsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFBO0lBQ3BCLFNBQVMsQ0FBQyxHQUFHLENBQUMsbUJBQW1CLENBQUMsQ0FBQztJQUNuQyxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7SUFDZixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztBQUN4QixDQUFDLENBQUM7QUFDRixJQUFJLFdBQVcsR0FBRztJQUNkLElBQUksSUFBSSxHQUFHLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUNyQixTQUFTLENBQUMsRUFBRSxDQUFDLG9CQU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