smartgulp/test/test.ts

44 lines
1011 B
TypeScript
Raw Normal View History

2018-09-02 12:35:49 +00:00
import { expect, tap } from '@pushrocks/tapbundle';
2017-04-29 22:25:31 +00:00
2018-09-02 12:35:49 +00:00
import * as smartgulp from '../ts/index';
2019-02-20 22:54:38 +00:00
import * as smartstream from '@pushrocks/smartstream';
2018-09-02 12:35:49 +00:00
import * as gulpFunction from 'gulp-function';
import * as smartq from 'smartq';
2017-04-29 22:25:31 +00:00
2018-09-02 12:35:49 +00:00
tap.test('smartgulp.src -> should read a directoy', async tools => {
let done = smartq.defer();
smartgulp
.src(['./test/testfiles/**/*.md'])
.pipe(
gulpFunction.forEach(async fileArg => {
console.log(fileArg.path);
})
)
.pipe(
gulpFunction.atEnd(async () => {
done.resolve();
})
);
await done.promise;
});
2017-04-29 22:25:31 +00:00
2018-02-15 23:46:55 +00:00
tap.test('smartgulp shoould replace files', async () => {
2018-09-02 12:35:49 +00:00
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;
});
2018-02-15 23:46:55 +00:00
2018-09-02 12:35:49 +00:00
tap.start();