update tests

This commit is contained in:
Philipp Kunz 2016-12-04 21:32:56 +01:00
parent 9d54da207f
commit 291583b17a
2 changed files with 34 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@ let myFunction = function () {
done.resolve()
return done.promise
}
let myFunction2 = function () {
let myFunction2 = function (file?) {
let done = Q.defer()
beautylog.ok('Function2 executed')
done.resolve()
@ -31,6 +31,18 @@ let beforeFunction = function () {
return done.promise
}
let logFileFunction = function (file) {
let done = Q.defer()
console.log(file.contents)
if (typeof file.contents !== 'undefined') {
} else {
throw new Error('file.contents not present')
}
done.resolve()
return done.promise
}
let middleFunctionRun = false
let middleFunction = function () {
@ -65,7 +77,7 @@ let timeoutFunction = function(){
describe('gulpFunction',function(){
it('should run through smoothly with ' + "'forEach'",function(done){
gulp.src('./test/*.md')
.pipe(gulpFunction(myFunction,'forEach'))
.pipe(gulpFunction(logFileFunction,'forEach'))
.pipe(gulp.dest('./test/result/'))
gulp.src('./test/*.md')
@ -105,7 +117,10 @@ describe('gulpFunction',function(){
return done2.promise
},'forEach'))
.pipe(gulpFunction(function(){
let done = Q.defer()
beautylog.log('nextStep')
done.resolve()
return done.promise
}))
.pipe(gulpFunction(afterFunction,'atEnd'))
.pipe(gulpFunction(timeoutFunction,'atEnd'))