Skip to content

Commit 98cce59

Browse files
committed
Create watch task
Keeps tests running in the background when files change
1 parent e195998 commit 98cce59

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

gulpfile.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const mocha = require('gulp-mocha');
33
const webpack = require('webpack-stream');
44
const ts = require('gulp-typescript');
55
const del = require('del');
6+
const watch = require('gulp-watch');
67

78
var tsProject = ts.createProject('tsconfig.json');
89

@@ -18,6 +19,12 @@ gulp.task('test', ['clean:test'], () =>
1819
.pipe(mocha())
1920
);
2021

22+
gulp.task('watch', function () {
23+
return watch(['src/**/*', 'test/**/*'], function () {
24+
gulp.start('test')
25+
})
26+
});
27+
2128
gulp.task('test-browser', function () {
2229
gulp
2330
.src(['./index.d.ts.', './src/main.ts', './src/**/*.ts', './test/fixtures.ts', './test/test-helper.ts', './test/**/*-test.ts'], { base: '.' })

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"gulp-clean": "^0.3.2",
3131
"gulp-mocha": "^3.0.1",
3232
"gulp-typescript": "^3.1.3",
33+
"gulp-watch": "4.3.11",
3334
"json-loader": "^0.5.4",
3435
"mocha": "^3.2.0",
3536
"sinon": "^1.17.6",

0 commit comments

Comments
 (0)