add replace()

This commit is contained in:
2018-02-16 00:46:55 +01:00
parent 867aa98155
commit 69c2cb0606
10 changed files with 293 additions and 107 deletions

View File

@ -1,11 +1,11 @@
import { expect, tap } from 'tapbundle'
import * as smartgulp from '../dist/index'
import * as smartgulp from '../ts/index'
import * as smartstream from 'smartstream'
import * as gulpFunction from 'gulp-function'
import * as smartq from 'smartq'
tap.test('smartgulp.src -> should read a directoy', async () => {
tap.test('smartgulp.src -> should read a directoy', async (tools) => {
let done = smartq.defer()
smartgulp.src(['./test/testfiles/**/*.md'])
.pipe(gulpFunction.forEach(async (fileArg) => {
@ -17,4 +17,17 @@ tap.test('smartgulp.src -> should read a directoy', async () => {
await done.promise
})
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
})
tap.start()