Files
gulp-function/test/test.ts

36 lines
885 B
TypeScript
Raw Normal View History

2024-03-10 23:29:56 +01:00
import { expect, tap } from '@push.rocks/tapbundle';
2017-04-30 00:44:11 +02:00
2024-03-10 23:29:56 +01:00
import * as smartgulp from '@push.rocks/smartgulp';
import gulp from 'gulp';
import * as gulpFunction from '../ts/index.js';
2016-10-19 07:36:32 +02:00
2024-03-10 23:29:56 +01:00
import * as smartpromise from '@push.rocks/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();