Skip to content

Commit

Permalink
Update: Add test to make sure no functions are kicked off when they s…
Browse files Browse the repository at this point in the history
…hould not
  • Loading branch information
nmccready authored and phated committed Dec 31, 2017
1 parent cacc173 commit bc352dd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit bc352dd

Please sign in to comment.