Skip to content

Commit bc352dd

Browse files
nmccreadyphated
authored andcommitted
Update: Add test to make sure no functions are kicked off when they should not
1 parent cacc173 commit bc352dd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/watch.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ describe('gulp', function() {
6161
});
6262

6363

64+
it('should not call the function when no file changes: no options', function(done) {
65+
var tempFile = path.join(outpath, 'watch-func.txt');
66+
67+
createTempFile(tempFile);
68+
69+
var watcher = gulp.watch(tempFile, function() {
70+
should.fail('Watcher erroneously called');
71+
});
72+
73+
setTimeout(function() {
74+
watcher.close();
75+
done();
76+
}, 10);
77+
});
78+
6479
it('should call the function when file changes: w/ options', function(done) {
6580
var tempFile = path.join(outpath, 'watch-func-options.txt');
6681

0 commit comments

Comments
 (0)