DefinitelyTyped/types/gulp-shell/gulp-shell-tests.ts
Giedrius Grabauskas 472244ccbf Types for gulp 4.0 (#16121)
* Update index.d.ts

* Rewrited types for gulp@4.0.

* Updated quotes

* Fixed tslint errors.

* Fixed some tslint error in test file.

* Implemented undertaker in gulp types.

* Removed Orchestrator import.

* Added backwards compatible type `TaskCallback`.

* Fixed `gulp-shell` tests compatibility with gulp@4 types.

* Fixed karma tests compatibility with gulp@4 types.

* Fixed gulp-rev-replace tests compatibility with gulp@4 types.

* Enabled `strictNullChecks` in `gulp` and `undertaker` types. Fixed task function.

* Implemented gulp.parallel for `karma` tests.

* Implemented gulp.parallel for `gulp-rev-replace` tests.

* Implemented gulp.parallel for `gulp-shell` tests.
2017-06-05 16:43:12 -07:00

40 lines
969 B
TypeScript

import shell = require('gulp-shell');
import gulp = require('gulp');
gulp.task('example', function () {
return gulp.src('*.js', {read: false})
.pipe(shell([
'echo <%= f(file.path) %>',
'ls -l <%= file.path %>'
], {
templateData: {
f: function (s: string) {
return s.replace(/$/, '.bak')
}
}
}))
});
gulp.task('shorthand', shell.task([
'echo hello',
'echo world'
]));
var paths: any = {
js: ['*.js', 'test/*.js']
};
gulp.task('test', shell.task('mocha -R spec'));
gulp.task('coverage', gulp.parallel('test', shell.task('istanbul cover _mocha -- -R spec')));
gulp.task('coveralls', gulp.parallel('coverage', shell.task('cat coverage/lcov.info | coveralls')));
gulp.task('lint', shell.task('eslint ' + paths.js.join(' ')));
gulp.task('default', gulp.parallel('coverage', 'lint'));
gulp.task('watch', function () {
gulp.watch(paths.js, ['default'])
});