gulp-function/test/test.ts

36 lines
885 B
TypeScript
Raw Permalink Normal View History

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