forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulp-shell-tests.ts
42 lines (32 loc) · 1012 Bytes
/
gulp-shell-tests.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/// <reference path="gulp-shell.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
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', ['test'], shell.task('istanbul cover _mocha -- -R spec'));
gulp.task('coveralls', ['coverage'], shell.task('cat coverage/lcov.info | coveralls'));
gulp.task('lint', shell.task('eslint ' + paths.js.join(' ')));
gulp.task('default', ['coverage', 'lint']);
gulp.task('watch', function () {
gulp.watch(paths.js, ['default'])
});