Skip to content

Commit

Permalink
Add a safety delay here
Browse files Browse the repository at this point in the history
  • Loading branch information
es128 committed Feb 18, 2015
1 parent 41354c5 commit 440aa32
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,18 +392,20 @@ function runTests(options) {
var testPath = getFixturePath('*');
var negatedPath = '!' + getFixturePath('*a*.txt');
var unlinkPath = getFixturePath('unlink.txt');
watcher = chokidar.watch([testPath, negatedPath], options)
.on('all', spy)
.on('ready', d(function() {
spy.should.have.been.calledOnce;
spy.should.have.been.calledWith('add', unlinkPath);
fs.unlinkSync(unlinkPath);
waitFor([[spy, 2], spy.withArgs('unlink')], function() {
if (!osXFsWatch) spy.should.have.been.calledTwice;
spy.should.have.been.calledWith('unlink', unlinkPath);
done();
});
}, true));
dd(function() {
watcher = chokidar.watch([testPath, negatedPath], options)
.on('all', spy)
.on('ready', d(function() {
spy.should.have.been.calledOnce;
spy.should.have.been.calledWith('add', unlinkPath);
fs.unlinkSync(unlinkPath);
waitFor([[spy, 2], spy.withArgs('unlink')], function() {
if (!osXFsWatch) spy.should.have.been.calledTwice;
spy.should.have.been.calledWith('unlink', unlinkPath);
done();
});
}, true));
})();
});
it('should traverse subdirs to match globstar patterns', function(done) {
var spy = sinon.spy();
Expand Down

0 comments on commit 440aa32

Please sign in to comment.