Files
gulp-function/test/test.ts

36 lines
882 B
TypeScript
Raw Permalink Normal View History

import { expect, tap } from '@pushrocks/tapbundle';
2017-04-30 00:44:11 +02:00
import * as smartgulp from '@pushrocks/smartgulp';
let gulp = require('gulp');
import * as gulpFunction from '../ts/index';
2016-10-19 07:36:32 +02:00
import * as smartpromise from '@pushrocks/smartpromise';
2016-12-04 21:32:56 +01: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-30 00:44:11 +02:00
if (counter === 2) {
done.resolve();
2017-04-30 00:44:11 +02:00
}
})
);
await done.promise;
});
2016-03-26 17:22:46 +01: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 17:22:46 +01:00
tap.start();