gulp-function/test/test.ts
2024-03-10 23:29:56 +01:00

36 lines
885 B
TypeScript

import { expect, tap } from '@push.rocks/tapbundle';
import * as smartgulp from '@push.rocks/smartgulp';
import gulp from 'gulp';
import * as gulpFunction from '../ts/index.js';
import * as smartpromise from '@push.rocks/smartpromise';
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++;
if (counter === 2) {
done.resolve();
}
})
);
await done.promise;
});
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;
});
tap.start();