From bc352dd943c4bbd5961901da3798df398d9f0434 Mon Sep 17 00:00:00 2001 From: Nick McCready Date: Thu, 10 Sep 2015 23:37:37 -0400 Subject: [PATCH] Update: Add test to make sure no functions are kicked off when they should not --- test/watch.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/watch.js b/test/watch.js index 788df4b4e..2dba7dab1 100644 --- a/test/watch.js +++ b/test/watch.js @@ -61,6 +61,21 @@ describe('gulp', function() { }); + it('should not call the function when no file changes: no options', function(done) { + var tempFile = path.join(outpath, 'watch-func.txt'); + + createTempFile(tempFile); + + var watcher = gulp.watch(tempFile, function() { + should.fail('Watcher erroneously called'); + }); + + setTimeout(function() { + watcher.close(); + done(); + }, 10); + }); + it('should call the function when file changes: w/ options', function(done) { var tempFile = path.join(outpath, 'watch-func-options.txt');