update tests
This commit is contained in:
parent
9d54da207f
commit
291583b17a
20
test/test.js
20
test/test.js
File diff suppressed because one or more lines are too long
19
test/test.ts
19
test/test.ts
@ -11,7 +11,7 @@ let myFunction = function () {
|
|||||||
done.resolve()
|
done.resolve()
|
||||||
return done.promise
|
return done.promise
|
||||||
}
|
}
|
||||||
let myFunction2 = function () {
|
let myFunction2 = function (file?) {
|
||||||
let done = Q.defer()
|
let done = Q.defer()
|
||||||
beautylog.ok('Function2 executed')
|
beautylog.ok('Function2 executed')
|
||||||
done.resolve()
|
done.resolve()
|
||||||
@ -31,6 +31,18 @@ let beforeFunction = function () {
|
|||||||
return done.promise
|
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 middleFunctionRun = false
|
||||||
|
|
||||||
let middleFunction = function () {
|
let middleFunction = function () {
|
||||||
@ -65,7 +77,7 @@ let timeoutFunction = function(){
|
|||||||
describe('gulpFunction',function(){
|
describe('gulpFunction',function(){
|
||||||
it('should run through smoothly with ' + "'forEach'",function(done){
|
it('should run through smoothly with ' + "'forEach'",function(done){
|
||||||
gulp.src('./test/*.md')
|
gulp.src('./test/*.md')
|
||||||
.pipe(gulpFunction(myFunction,'forEach'))
|
.pipe(gulpFunction(logFileFunction,'forEach'))
|
||||||
.pipe(gulp.dest('./test/result/'))
|
.pipe(gulp.dest('./test/result/'))
|
||||||
|
|
||||||
gulp.src('./test/*.md')
|
gulp.src('./test/*.md')
|
||||||
@ -105,7 +117,10 @@ describe('gulpFunction',function(){
|
|||||||
return done2.promise
|
return done2.promise
|
||||||
},'forEach'))
|
},'forEach'))
|
||||||
.pipe(gulpFunction(function(){
|
.pipe(gulpFunction(function(){
|
||||||
|
let done = Q.defer()
|
||||||
beautylog.log('nextStep')
|
beautylog.log('nextStep')
|
||||||
|
done.resolve()
|
||||||
|
return done.promise
|
||||||
}))
|
}))
|
||||||
.pipe(gulpFunction(afterFunction,'atEnd'))
|
.pipe(gulpFunction(afterFunction,'atEnd'))
|
||||||
.pipe(gulpFunction(timeoutFunction,'atEnd'))
|
.pipe(gulpFunction(timeoutFunction,'atEnd'))
|
||||||
|
Loading…
Reference in New Issue
Block a user