Skip to content

Commit

Permalink
Test delay tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
es128 committed Apr 21, 2015
1 parent 3f631ba commit 74cc53f
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions test.js
Expand Up @@ -1218,19 +1218,21 @@ function runTests(options) {
var subdir = sysPath.join(fixturesDir, 'subdir');
var changeFile = sysPath.join(fixturesDir, 'change.txt');
var watchPaths = [subdir, changeFile];
watcher = chokidar.watch(watchPaths, options)
.on('all', spy)
.on('ready', d(function() {
watcher.unwatch(subdir);
fs.writeFileSync(getFixturePath('subdir/add.txt'), 'c');
fs.writeFileSync(getFixturePath('change.txt'), 'c');
waitFor([spy], function() {
spy.should.have.been.calledWith('change', changeFile);
spy.should.not.have.been.calledWith('add');
if (!osXFsWatch) spy.should.have.been.calledOnce;
done();
});
}));
dd(function() {
watcher = chokidar.watch(watchPaths, options)
.on('all', spy)
.on('ready', d(function() {
watcher.unwatch(subdir);
fs.writeFileSync(getFixturePath('subdir/add.txt'), 'c');
fs.writeFileSync(getFixturePath('change.txt'), 'c');
waitFor([spy], function() {
spy.should.have.been.calledWith('change', changeFile);
spy.should.not.have.been.calledWith('add');
if (!osXFsWatch) spy.should.have.been.calledOnce;
done();
});
}));
})();
});
});
describe('close', function() {
Expand Down

0 comments on commit 74cc53f

Please sign in to comment.