Skip to content

Commit

Permalink
Add test on #119
Browse files Browse the repository at this point in the history
Closes #119
  • Loading branch information
floatdrop committed Jan 21, 2015
1 parent 7f9e9ac commit 67914be
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
20 changes: 0 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,2 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
.tags
.tags_sorted_by_file
.gemtags
.DS_Store
coverage

pids
logs
results
temp

npm-debug.log
node_modules
test/fixtures/new.js
31 changes: 31 additions & 0 deletions test/ignore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* global describe, it, afterEach */

var watch = require('..');
var join = require('path').join;
var rimraf = require('rimraf');
var touch = require('./touch.js');
var fs = require('fs');
require('should');

function fixtures(glob) {
return join(__dirname, 'fixtures', glob);
}

describe('ignore', function () {
var w;

it('should ignore non-existent folders', function (done) {
rimraf.sync(fixtures('temp'));

w = watch([fixtures('**/*.ts'), '!' + fixtures('temp')], function () {
done('Ignored folder was watched');
});

w.on('ready', function () {
fs.mkdirSync(fixtures('temp'));
touch(fixtures('temp/index.ts'))();
rimraf.sync(fixtures('temp'));
setTimeout(done, 200);
});
});
});

0 comments on commit 67914be

Please sign in to comment.