forked from charlypoly/spotify-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (37 loc) · 1.2 KB
/
gulpfile.js
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
43
44
45
const gulp = require('gulp');
const ts = require('gulp-typescript');
const jasmine = require('gulp-jasmine');
const clean = require('gulp-clean');
const runSequence = require('run-sequence');
gulp.task('build', function() {
const merge = require('merge2');
const tsProject = ts.createProject('tsconfig.json');
var tsResult = tsProject.src()
.pipe(tsProject());
return merge([
tsResult.dts.pipe(gulp.dest('./definitions')),
tsResult.js.pipe(gulp.dest(tsProject.config.compilerOptions.outDir))
]);
});
gulp.task('clean', function () {
return gulp.src('dist', { read: false })
.pipe(clean());
});
gulp.task('test:run', function() {
return gulp.src('dist/spec/**')
.pipe(jasmine());
});
gulp.task('test:copy_fixtures', () => {
return gulp.src('./spec/fixtures/*')
.pipe(gulp.dest('./dist/spec/fixtures/'));
});
gulp.task('watch', ['default'], function() {
gulp.watch('lib/*.ts', ['default']);
gulp.watch('examples/*.ts', ['default']);
});
gulp.task('test', [], function(cb) {
runSequence('clean', 'build', 'test:copy_fixtures', 'test:run', cb);
});
gulp.task('default', [], function(cb) {
runSequence('clean', 'build', cb);
});