smartgulp/test/test.ts

34 lines
903 B
TypeScript
Raw Normal View History

2017-04-29 22:25:31 +00:00
import { expect, tap } from 'tapbundle'
2018-02-15 23:46:55 +00:00
import * as smartgulp from '../ts/index'
2017-04-29 22:25:31 +00:00
import * as smartstream from 'smartstream'
import * as gulpFunction from 'gulp-function'
import * as smartq from 'smartq'
2018-02-15 23:46:55 +00:00
tap.test('smartgulp.src -> should read a directoy', async (tools) => {
2017-04-29 22:25:31 +00:00
let done = smartq.defer()
2017-04-29 23:13:53 +00:00
smartgulp.src(['./test/testfiles/**/*.md'])
2017-04-29 22:25:31 +00:00
.pipe(gulpFunction.forEach(async (fileArg) => {
console.log(fileArg.path)
}))
.pipe(gulpFunction.atEnd(async () => {
2017-04-29 23:13:53 +00:00
done.resolve()
2017-04-29 22:25:31 +00:00
}))
await done.promise
})
2018-02-15 23:46:55 +00:00
tap.test('smartgulp shoould replace files', async () => {
let done = smartq.defer()
smartgulp.src(['./test/testfiles/**/*.md'])
.pipe(gulpFunction.forEach(async (fileArg) => {
console.log(fileArg.path)
}))
.pipe(gulpFunction.atEnd(async () => {
done.resolve()
}))
.pipe(smartgulp.replace())
await done.promise
})
2017-04-29 22:25:31 +00:00
tap.start()