2017-04-29 22:44:11 +00:00
|
|
|
import { expect, tap } from 'tapbundle'
|
|
|
|
|
2016-10-19 05:36:32 +00:00
|
|
|
let gulp = require('gulp')
|
2017-04-29 22:44:11 +00:00
|
|
|
import * as gulpFunction from '../dist/index'
|
2016-10-19 05:36:32 +00:00
|
|
|
|
|
|
|
import * as beautylog from 'beautylog'
|
2017-04-29 22:44:11 +00:00
|
|
|
let smartq = require('smartq')
|
2016-12-04 20:32:56 +00:00
|
|
|
|
2016-03-26 16:22:46 +00:00
|
|
|
|
2017-04-29 22:44:11 +00:00
|
|
|
tap.test('should run through smoothly with ' + "'forEach'", async (tools) => {
|
|
|
|
let done = smartq.defer()
|
|
|
|
let counter = 0
|
|
|
|
gulp.src('./test/*.md')
|
|
|
|
.pipe(gulpFunction.forEach(async () => {
|
|
|
|
counter++
|
|
|
|
if (counter === 2) {
|
2016-10-19 05:36:32 +00:00
|
|
|
done.resolve()
|
2017-04-29 22:44:11 +00:00
|
|
|
}
|
|
|
|
}))
|
|
|
|
await done.promise
|
|
|
|
})
|
2016-03-26 16:22:46 +00:00
|
|
|
|
2017-04-29 22:44:11 +00:00
|
|
|
tap.test('should run through smoothly with ' + "'forEach'", async (tools) => {
|
|
|
|
let done = smartq.defer()
|
|
|
|
let counter = 0
|
|
|
|
gulp.src('./test/*.md')
|
|
|
|
.pipe(gulpFunction.atEnd(async () => {
|
|
|
|
console.log('atEnd')
|
|
|
|
done.resolve()
|
|
|
|
}))
|
|
|
|
await done.promise
|
2016-10-19 05:36:32 +00:00
|
|
|
})
|
2016-03-26 16:22:46 +00:00
|
|
|
|
2017-04-29 22:44:11 +00:00
|
|
|
tap.start()
|