gulp-function/test/test.ts

36 lines
882 B
TypeScript
Raw Normal View History

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