Skip to content

Commit

Permalink
Skip #682 tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Sep 6, 2018
1 parent 6e112b9 commit a30eccf
Showing 1 changed file with 135 additions and 133 deletions.
268 changes: 135 additions & 133 deletions test.js
Expand Up @@ -637,23 +637,6 @@ function runTests(baseopts) {
});
});
});
it('should detect unlink while watching a non-existent second file in another directory', function(done) {
var spy = sinon.spy();
var testPath = getFixturePath('unlink.txt');
var otherDirPath = getFixturePath('other-dir');
var otherPath = getFixturePath('other-dir/other.txt');
fs.mkdirSync(otherDirPath, PERM_ARR);
// intentionally for this test don't write fs.writeFileSync(otherPath, 'other');
watcher = chokidar.watch([testPath, otherPath], options)
.on('unlink', spy)
.on('ready', function() {
w(fs.unlink.bind(fs, testPath, simpleCb))();
waitFor([spy], function() {
spy.should.have.been.calledWith(testPath);
done();
});
});
});
it('should detect unlink and re-add', function(done) {
options.ignoreInitial = true;
var unlinkSpy = sinon.spy(function unlinkSpy(){});
Expand All @@ -674,122 +657,141 @@ function runTests(baseopts) {
}));
});
});
it('should detect unlink and re-add while watching a second file', function(done) {
options.ignoreInitial = true;
var unlinkSpy = sinon.spy(function unlinkSpy(){});
var addSpy = sinon.spy(function addSpy(){});
var testPath = getFixturePath('unlink.txt');
var otherPath = getFixturePath('other.txt');
fs.writeFileSync(otherPath, 'other');
watcher = chokidar.watch([testPath, otherPath], options)
.on('unlink', unlinkSpy)
.on('add', addSpy)
.on('ready', function() {
w(fs.unlink.bind(fs, testPath, simpleCb))();
waitFor([unlinkSpy], w(function() {
unlinkSpy.should.have.been.calledWith(testPath);
w(fs.writeFile.bind(fs, testPath, 're-added', simpleCb))();
waitFor([addSpy], function() {
addSpy.should.have.been.calledWith(testPath);
done();
});
}));
});
});
it('should detect unlink and re-add while watching a non-existent second file in another directory', function(done) {
options.ignoreInitial = true;
var unlinkSpy = sinon.spy(function unlinkSpy(){});
var addSpy = sinon.spy(function addSpy(){});
var testPath = getFixturePath('unlink.txt');
var otherDirPath = getFixturePath('other-dir');
var otherPath = getFixturePath('other-dir/other.txt');
fs.mkdirSync(otherDirPath, PERM_ARR);
// intentionally for this test don't write fs.writeFileSync(otherPath, 'other');
watcher = chokidar.watch([testPath, otherPath], options)
.on('unlink', unlinkSpy)
.on('add', addSpy)
.on('ready', function() {
w(fs.unlink.bind(fs, testPath, simpleCb))();
waitFor([unlinkSpy], w(function() {
unlinkSpy.should.have.been.calledWith(testPath);
w(fs.writeFile.bind(fs, testPath, 're-added', simpleCb))();
waitFor([addSpy], function() {
addSpy.should.have.been.calledWith(testPath);
done();
});
}));
});
});
it('should detect unlink and re-add while watching a non-existent second file in the same directory', function(done) {
options.ignoreInitial = true;
var unlinkSpy = sinon.spy(function unlinkSpy(){});
var addSpy = sinon.spy(function addSpy(){});
var testPath = getFixturePath('unlink.txt');
var otherPath = getFixturePath('other.txt');
// intentionally for this test don't write fs.writeFileSync(otherPath, 'other');
watcher = chokidar.watch([testPath, otherPath], options)
.on('unlink', unlinkSpy)
.on('add', addSpy)
.on('ready', function() {
w(fs.unlink.bind(fs, testPath, simpleCb))();
waitFor([unlinkSpy], w(function() {
unlinkSpy.should.have.been.calledWith(testPath);
w(fs.writeFile.bind(fs, testPath, 're-added', simpleCb))();
waitFor([addSpy], function() {
addSpy.should.have.been.calledWith(testPath);
done();
});
}));
});
});
it('should detect two unlinks and one re-add', function(done) {
options.ignoreInitial = true;
var unlinkSpy = sinon.spy(function unlinkSpy(){});
var addSpy = sinon.spy(function addSpy(){});
var testPath = getFixturePath('unlink.txt');
var otherPath = getFixturePath('other.txt');
fs.writeFileSync(otherPath, 'other');
watcher = chokidar.watch([testPath, otherPath], options)
.on('unlink', unlinkSpy)
.on('add', addSpy)
.on('ready', function() {
w(fs.unlink.bind(fs, otherPath, simpleCb))();
w(fs.unlink.bind(fs, testPath, simpleCb))();
waitFor([[unlinkSpy, 2]], w(function() {
unlinkSpy.should.have.been.calledWith(otherPath);
unlinkSpy.should.have.been.calledWith(testPath);
w(fs.writeFile.bind(fs, testPath, 're-added', simpleCb))();
waitFor([addSpy], function() {
addSpy.should.have.been.calledWith(testPath);
done();
});
}));
});
});
it('should detect unlink and re-add while watching a second file and a non-existent third file', function(done) {
options.ignoreInitial = true;
var unlinkSpy = sinon.spy(function unlinkSpy(){});
var addSpy = sinon.spy(function addSpy(){});
var testPath = getFixturePath('unlink.txt');
var otherPath = getFixturePath('other.txt');
var other2Path = getFixturePath('other2.txt');
fs.writeFileSync(otherPath, 'other');
// intentionally for this test don't write fs.writeFileSync(other2Path, 'other2');
watcher = chokidar.watch([testPath, otherPath, other2Path], options)
.on('unlink', unlinkSpy)
.on('add', addSpy)
.on('ready', function() {
w(fs.unlink.bind(fs, testPath, simpleCb))();
waitFor([unlinkSpy], w(function() {
unlinkSpy.should.have.been.calledWith(testPath);
w(fs.writeFile.bind(fs, testPath, 're-added', simpleCb))();
waitFor([addSpy], function() {
addSpy.should.have.been.calledWith(testPath);
done();
});
}));
});
});

// PR 682.
// it('should detect unlink while watching a non-existent second file in another directory', function(done) {
// var spy = sinon.spy();
// var testPath = getFixturePath('unlink.txt');
// var otherDirPath = getFixturePath('other-dir');
// var otherPath = getFixturePath('other-dir/other.txt');
// fs.mkdirSync(otherDirPath, PERM_ARR);
// // intentionally for this test don't write fs.writeFileSync(otherPath, 'other');
// watcher = chokidar.watch([testPath, otherPath], options)
// .on('unlink', spy)
// .on('ready', function() {
// w(fs.unlink.bind(fs, testPath, simpleCb))();
// waitFor([spy], function() {
// spy.should.have.been.calledWith(testPath);
// done();
// });
// });
// });
// it('should detect unlink and re-add while watching a second file', function(done) {
// options.ignoreInitial = true;
// var unlinkSpy = sinon.spy(function unlinkSpy(){});
// var addSpy = sinon.spy(function addSpy(){});
// var testPath = getFixturePath('unlink.txt');
// var otherPath = getFixturePath('other.txt');
// fs.writeFileSync(otherPath, 'other');
// watcher = chokidar.watch([testPath, otherPath], options)
// .on('unlink', unlinkSpy)
// .on('add', addSpy)
// .on('ready', function() {
// w(fs.unlink.bind(fs, testPath, simpleCb))();
// waitFor([unlinkSpy], w(function() {
// unlinkSpy.should.have.been.calledWith(testPath);
// w(fs.writeFile.bind(fs, testPath, 're-added', simpleCb))();
// waitFor([addSpy], function() {
// addSpy.should.have.been.calledWith(testPath);
// done();
// });
// }));
// });
// });
// it('should detect unlink and re-add while watching a non-existent second file in another directory', function(done) {
// options.ignoreInitial = true;
// var unlinkSpy = sinon.spy(function unlinkSpy(){});
// var addSpy = sinon.spy(function addSpy(){});
// var testPath = getFixturePath('unlink.txt');
// var otherDirPath = getFixturePath('other-dir');
// var otherPath = getFixturePath('other-dir/other.txt');
// fs.mkdirSync(otherDirPath, PERM_ARR);
// // intentionally for this test don't write fs.writeFileSync(otherPath, 'other');
// watcher = chokidar.watch([testPath, otherPath], options)
// .on('unlink', unlinkSpy)
// .on('add', addSpy)
// .on('ready', function() {
// w(fs.unlink.bind(fs, testPath, simpleCb))();
// waitFor([unlinkSpy], w(function() {
// unlinkSpy.should.have.been.calledWith(testPath);
// w(fs.writeFile.bind(fs, testPath, 're-added', simpleCb))();
// waitFor([addSpy], function() {
// addSpy.should.have.been.calledWith(testPath);
// done();
// });
// }));
// });
// });
// it('should detect unlink and re-add while watching a non-existent second file in the same directory', function(done) {
// options.ignoreInitial = true;
// var unlinkSpy = sinon.spy(function unlinkSpy(){});
// var addSpy = sinon.spy(function addSpy(){});
// var testPath = getFixturePath('unlink.txt');
// var otherPath = getFixturePath('other.txt');
// // intentionally for this test don't write fs.writeFileSync(otherPath, 'other');
// watcher = chokidar.watch([testPath, otherPath], options)
// .on('unlink', unlinkSpy)
// .on('add', addSpy)
// .on('ready', function() {
// w(fs.unlink.bind(fs, testPath, simpleCb))();
// waitFor([unlinkSpy], w(function() {
// unlinkSpy.should.have.been.calledWith(testPath);
// w(fs.writeFile.bind(fs, testPath, 're-added', simpleCb))();
// waitFor([addSpy], function() {
// addSpy.should.have.been.calledWith(testPath);
// done();
// });
// }));
// });
// });
// it('should detect two unlinks and one re-add', function(done) {
// options.ignoreInitial = true;
// var unlinkSpy = sinon.spy(function unlinkSpy(){});
// var addSpy = sinon.spy(function addSpy(){});
// var testPath = getFixturePath('unlink.txt');
// var otherPath = getFixturePath('other.txt');
// fs.writeFileSync(otherPath, 'other');
// watcher = chokidar.watch([testPath, otherPath], options)
// .on('unlink', unlinkSpy)
// .on('add', addSpy)
// .on('ready', function() {
// w(fs.unlink.bind(fs, otherPath, simpleCb))();
// w(fs.unlink.bind(fs, testPath, simpleCb))();
// waitFor([[unlinkSpy, 2]], w(function() {
// unlinkSpy.should.have.been.calledWith(otherPath);
// unlinkSpy.should.have.been.calledWith(testPath);
// w(fs.writeFile.bind(fs, testPath, 're-added', simpleCb))();
// waitFor([addSpy], function() {
// addSpy.should.have.been.calledWith(testPath);
// done();
// });
// }));
// });
// });
// it('should detect unlink and re-add while watching a second file and a non-existent third file', function(done) {
// options.ignoreInitial = true;
// var unlinkSpy = sinon.spy(function unlinkSpy(){});
// var addSpy = sinon.spy(function addSpy(){});
// var testPath = getFixturePath('unlink.txt');
// var otherPath = getFixturePath('other.txt');
// var other2Path = getFixturePath('other2.txt');
// fs.writeFileSync(otherPath, 'other');
// // intentionally for this test don't write fs.writeFileSync(other2Path, 'other2');
// watcher = chokidar.watch([testPath, otherPath, other2Path], options)
// .on('unlink', unlinkSpy)
// .on('add', addSpy)
// .on('ready', function() {
// w(fs.unlink.bind(fs, testPath, simpleCb))();
// waitFor([unlinkSpy], w(function() {
// unlinkSpy.should.have.been.calledWith(testPath);
// w(fs.writeFile.bind(fs, testPath, 're-added', simpleCb))();
// waitFor([addSpy], function() {
// addSpy.should.have.been.calledWith(testPath);
// done();
// });
// }));
// });
// });
it('should ignore unwatched siblings', function(done) {
var spy = sinon.spy();
var testPath = getFixturePath('add.txt');
Expand Down

0 comments on commit a30eccf

Please sign in to comment.