Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Gulp.js to run Jasmine tests automatically?

I have basic Gulp tasks, and the basic Jasmine test runner set up. How do I use Gulp to run my Jasmine tests on a file save and show me the output? Where in the pipeline should Jasmine go?

I'm new to both these libraries and to JS build and unit testing systems generally, so unsure of the issues and best practice and I haven't found anything online that is basic enough for me :-)

like image 220
conradj Avatar asked Nov 01 '22 00:11

conradj


1 Answers

You can make use of gulp.watch, this watches files and does something when a file changes.

You could make a task like this, or simply use the gulp.watch in another task.

gulp.task('watch', function () {
    gulp.watch('tests/**/*', ['jasmine']);
});
like image 125
Allan Kimmer Jensen Avatar answered Nov 08 '22 05:11

Allan Kimmer Jensen