forked from phts/nodejs-torrent-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
31 lines (25 loc) · 800 Bytes
/
gulpfile.js
File metadata and controls
31 lines (25 loc) · 800 Bytes
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
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var ts = require('gulp-typescript');
var tsProject = ts.createProject('tsconfig.json');
gulp.task('default', ['compile']);
gulp.task('compile', function () {
return gulp.src('app/**/*.ts')
.pipe(ts(tsProject))
.pipe(gulp.dest('js/app'));
});
gulp.task('compile-tests', ['compile'], function () {
return gulp.src('test/**/*.ts')
.pipe(ts(tsProject))
.pipe(gulp.dest('js/test'));
});
gulp.task('watch', function () {
gulp.watch('app/**/*.ts', ['compile']);
});
gulp.task('watch-test', function () {
gulp.watch(['app/**/*.ts', 'test/**/*.ts'], ['test']);
});
gulp.task('test', ['compile-tests'], function () {
return gulp.src('js/test/**/*.test.js', {read: false})
.pipe(mocha({reporter: 'spec'}));
});